File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 10255
    
    8

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: 10255
    
    8

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.
 
wood burning stoves
 
subject: how to get system font?