cancel
Showing results for 
Search instead for 
Did you mean: 

Font Family

Former Member
0 Kudos

hi,

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

thanks and regards

trilochan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

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

Regards

Nithya