Solved

What fonts can I use in a Java application?

Posted on 2006-07-08
9
283 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:stev0931
  • 4
  • 3
  • 2
9 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 17065506
I always restrict myself to Arial Times and Courier.
That's enough for me and safe.
;JOOP!
0
 

Author Comment

by:stev0931
ID: 17065522
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
 
LVL 24

Expert Comment

by:sciuriware
ID: 17065583
Those were 3; for the rest ... I am sorry.

;JOOP!
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:stev0931
ID: 17065594
Must have hit the wrong key on the board.  
0
 
LVL 26

Accepted Solution

by:
ksivananth earned 125 total points
ID: 17066386
Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();

will return all the fonts installed in the system!
0
 

Author Comment

by:stev0931
ID: 17066394
Great!  Thanks!
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 17066396
then you can decide which font to use based on the availability!
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17067190
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
 

Author Comment

by:stev0931
ID: 17068317
That helps, thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 99
servlet web applications   metadata-complete="true" or false 3 44
Android development question 2 38
String array comparison 4 34
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question