Skip to Content
avatar image
Former Member

Font Family

hi,

how we can access all the fonts and according to that font how we set style.

thanks and regards

trilochan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 27, 2007 at 10:24 AM

    Hi

    Get all the fonts in a ArrayList and use from the ArrayList by their index value.

    Regards

    Nithya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 27, 2007 at 10:25 AM

    Hello Trilochan,

    regarding the first part of your question: The set of all available fonts can be retrieved via

    Font[] fonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    

    Regarding the second part: I am not sure I understand what you mean. Can you please explain?

    Regards,

    Jens

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi Jens,

      This is fine ..even i used the same code to get the font thanks...

      but my requirement is bit more...i need to show the <b>font styles and font size</b> also. Do we have code for this also ?

      I have the same requirement which you find in MSWORD font option.

      Regards

      Trilochan