wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes how to get system font? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to get system font?" Watch "how to get system font?" New topic
Author

how to get system font?

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

how to obtain native system font ??
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

GraphicsEnvironment#getAllFonts
GraphicsEnvironment#getAvailableFontFamilyNames


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

Yes,
but how to know the present system font in use?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

That would depend on the LAF and the component being used.
You can retrieve it using UIManager.get("Label.font");
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

thank you,
from a existing component, i get system font by getFont() with out assigning a custom font to that component.
 
jQuery in Action, 2nd edition
 
subject: how to get system font?
 
Similar Threads
Tips on using this discussion software
Exception
how to connect argox os 2140 to system and how set font and barcode link to system
How do I include a custom font in a NetBean project?
System Tray