What fonts can I use in a Java application?

If I want my java application to run on a Windows box or a Unix box, What fonts can I use with Java such that I can be guaranteed of the font’s availability on all target operating systems?  Will Java allow me to define and use any font?  Or is there a list of fonts that I have to use with Java?  (Or per target operating system?)

Note that this will run locally on the machine - this will not be an applet or web-based program.
stev0931Asked:
Who is Participating?
 
ksivananthCommented:
Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();

will return all the fonts installed in the system!
0
 
sciuriwareCommented:
I always restrict myself to Arial Times and Courier.
That's enough for me and safe.
;JOOP!
0
 
stev0931Author Commented:
This doesn't really answer my question.  I need more than 2 fonts and need to know what fonts I have to choose from.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
sciuriwareCommented:
Those were 3; for the rest ... I am sorry.

;JOOP!
0
 
stev0931Author Commented:
Must have hit the wrong key on the board.  
0
 
stev0931Author Commented:
Great!  Thanks!
0
 
ksivananthCommented:
then you can decide which font to use based on the availability!
0
 
sciuriwareCommented:
Just a note: I cross develop between LINUX and MSWindows.
I found that equal named fonts sometimes look very different on both systems.
Further, the size might be unexpectedly different when you think texts will fit.
I have to test all my GUI stuff again and again.
I was told that all this trouble comes from the patenting of some fonts and display techniques
by Adobe. True? We surely suffer.
That's why I restricted my font choice.
;JOOP!
0
 
stev0931Author Commented:
That helps, thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.