How can I get all font faces?

H

Hans Stoessel

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
 
R

Roedy Green

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.
 
H

Hans Stoessel

Hi

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

Thanks
Hans
 
R

RedGrittyBrick

Hans said:
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

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?
 
H

Hans Stoessel

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.
 
R

RedGrittyBrick

Hans Stoessel wrote:

>
> 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."
 
J

Jeffrey H. Coffield

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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top