I haven't asked this before because it felt like I really should be able to figure it out for myself - but I haven't!
I downloaded the Sun Java API so I could access it quickly. It seems that I read somewhere that the API was searchable. HOW? For example, if I want to find the Font class, I scroll down the "all classes" list looking for something that resembles "Font". Surely there's a better way? Even if I don't know which package Font might be in?
PS - And, while I'm at it, how do I find the "constant value" names that can be used to refer to different fonts? [ September 13, 2007: Message edited by: Jinny Morris ]
Look at the top of the main page and you'll see an "Index" link. (In fact I think every page has this link.) Click on that, then choose the "F" page and you'll find the Font class there.
In the docs for the Font class you'll see all the constants like Font.BOLD in the "Fields" section.
Joined: Apr 29, 2007
Thank you! It works beautifully!
The reason for the second question is this: in Just Java 2, van der Linden presents a program which scrolls text around on the screen. The font constructor he uses is:
I'm wondering where I can find that "TimesRoman" is a legitimate font name, and what other "standard" font names I can use. I've tried wandering around various constant values in the API but can't find a list of specific font names that can be used.
You can use any font that's installed in the system where the application is running. Obviously Sun can't know about every font that anyone has ever written, so it can't provide the list you are asking for.
The API documentation for the Font class says this:
The getAllFonts method of the GraphicsEnvironment class returns an array of all font faces available in the system.
That might be of some help in your application.
Joined: Apr 29, 2007
Ah ... Thank you! Should have tried that - I was lazily looking for an easier way!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com