Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What fonts can I use in a Java application?

Posted on 2006-07-08
9
Medium Priority
?
320 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

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

Accepted Solution

by:
ksivananth earned 500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

916 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