Solved

What fonts can I use in a Java application?

Posted on 2006-07-08
9
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven module vs maven project 3 74
How to log java errors in tomcat 8 24
Where to place postgres JDBC driver jar on tomcat 8 31
How to change fonts in windows live mail 3 22
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 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