Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

How can I get all font faces?

Thread view: 
Hans Stoessel - 14 Jan 2008 15:30 GMT
Hi

I like to have a dialog where I can select a font. I want to see all fonts,
not only the font families.

The problem:

-
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()
doesn't get the font faces, only the families.

- GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() doesn't
get all font faces. I miss a few of them

How can I solve that?

Thanks for the help
Hans
Roedy Green - 14 Jan 2008 17:08 GMT
On Mon, 14 Jan 2008 16:30:22 +0100, "Hans Stoessel"
<hstoessel.list@pm-medici.ch> wrote, quoted or indirectly quoted
someone who said :

>GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()
>doesn't get the font faces, only the families.

to get them use the attributes Font.PLAIN Font.BOLD Font.ITALIC
Font.BOLD|Font.Italic.

Java glues the font variants together for you.
Signature

Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com

Jeffrey H. Coffield - 16 Jan 2008 23:50 GMT
> On Mon, 14 Jan 2008 16:30:22 +0100, "Hans Stoessel"
> <hstoessel.list@pm-medici.ch> wrote, quoted or indirectly quoted
[quoted text clipped - 7 lines]
>
> Java glues the font variants together for you.

The assumption that a font can only have PLAIN, BOLD, ITALIC &
BOLD-ITALIC is one of the places Java missed the boat. I had to write a
custom JFontSelector and set up a font server to get all the variants to
work correctly on Linux, Mac and Windoze.

Jeff Coffield
Hans Stoessel - 14 Jan 2008 17:13 GMT
Hi

And how can I build a list with ALL font face to choose a font?

Thanks
Hans

> Hi
>
[quoted text clipped - 14 lines]
> Thanks for the help
> Hans
Roedy Green - 14 Jan 2008 21:33 GMT
On Mon, 14 Jan 2008 18:13:33 +0100, "Hans Stoessel"
<hstoessel.list@pm-medici.ch> wrote, quoted or indirectly quoted
someone who said :

>And how can I build a list with ALL font face to choose a font?

In Java there are only 4 variants on a font family.
Signature

Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com

RedGrittyBrick - 15 Jan 2008 11:28 GMT
> Hi
>
[quoted text clipped - 9 lines]
> - GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() doesn't
> get all font faces. I miss a few of them

Can you give an example of a specific font face which is missing on a
specific platform (e.g. Windows XP SP2)?

Do the "missing" font faces show up in some non-Java application? If so
which one?
Hans Stoessel - 15 Jan 2008 11:44 GMT
Hi

Yes, the font is shown in Microsoft Word f.e..

I have a font named "Frutiger LT" (family). From this font there are
different fonts like "Frutiger LT 45 Light" f.e.

>> Hi
>>
[quoted text clipped - 15 lines]
> Do the "missing" font faces show up in some non-Java application? If so
> which one?
Roedy Green - 15 Jan 2008 12:47 GMT
On Tue, 15 Jan 2008 12:44:42 +0100, "Hans Stoessel"
<hstoessel.list@pm-medici.ch> wrote, quoted or indirectly quoted
someone who said :

>I have a font named "Frutiger LT" (family). From this font there are
>different fonts like "Frutiger LT 45 Light" f.e.

the only fonts you can use in Java are the ones displayed in the
FontShower.  See http://mindprod.com/applet/fontshower.html

That will tell you their official names.
Signature

Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com

RedGrittyBrick - 15 Jan 2008 15:24 GMT
<top posting "corrected">

>>> Hi
>>>
[quoted text clipped - 17 lines]
>
> Yes, the font is shown in Microsoft Word f.e..

Word 2003 only shows me font family names, not font names!

> I have a font named "Frutiger LT" (family). From this font there are
> different fonts like "Frutiger LT 45 Light" f.e.

Is that the OpenType font - PostScript flavour (.OTF)
Or the OpenType font - TrueType flavour (.TTF)?

I just downloaded the free Metro Sans Light OTF from
http://www.fonthaus.com/specials/ and found Java does not display it
although Word 2003 does.

I suspect JRE 1.6 does not support OpenType OTF fonts.

<later> Roedy's web site confirms this
http://mindprod.com/jgloss/opentype.html says:
"Under the hood, OpenType fonts come in two flavours, TTF and
PostScript. In Windows, Java is only interested in OpenType TTF fonts
and TTF fonts. In Linux, Java in only interested in OpenType PS fonts
and PS fonts."


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.