|
-
April 5th, 1999, 08:43 AM
#1
Getting available fonts
I am trying to get the availalable font types on the system which is running my java application. Right now I use a call to:
fonts = Toolkit.getDefaultToolkit().getFontList();
This only returns a couple of fonts (specifically the fonts available in the awt toolkit). I really want all the fonts available on the system. I am using Windows NT as my platform.
Does anyone have any ideas?
Mich
-
April 6th, 1999, 11:10 AM
#2
Re: Getting available fonts
You can see only the fonts known by the Java Runtime. In the help which comes with the JDK you find information how to add a new font to the Java Runtime.
Unfortunatelly, you should do it by hand, modifying the font.properties file.
-
April 6th, 1999, 12:19 PM
#3
Re: Getting available fonts
Hi.
Actually, it is possible.
What I did last winter (when doing a simple paint applet) was something like this:
FontX oFontX = new FontX();
String[] oFonts = oFontx.getFontList();
(you might have to import com.ms.awt.*)
This works for getting all the available font types (for example for loading into a combo box) but that doesn't change the fact that you can't use any TrueType fonts in the applet. At least I couldn't. Let me know if you find out.
-
April 21st, 1999, 02:20 AM
#4
Re: Getting available fonts
hi,
the piece of code which iam giving will fetch all possible fonts on ur system.Actually it filled out my entire dos window .
this works with java 2 only.
create an array of Font,
u have to use awt package for this.
GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
fonts=ge.getAllFonts();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|