dcsimg
Problems using a Light weight font with java.awt
0 posts in topic
Thread View Thread View
TOPIC ACTIONS:
 

Problems using a Light weight font with java.awt...
amatra
Tue Mar 12, 2013 10:16 AM

On my Mac, GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() returns for the Helvetica font family :

  Font[family=Helvetica,name=Helvetica,style=plain,size=1]
  Font[family=Helvetica,name=Helvetica-Bold,style=plain,size=1]
  Font[family=Helvetica,name=Helvetica-BoldOblique,style=plain,size=1]
  Font[family=Helvetica,name=Helvetica-Light,style=plain,size=1]
  Font[family=Helvetica,name=Helvetica-LightOblique,style=plain,size=1]
  Font[family=Helvetica,name=Helvetica-Oblique,style=plain,size=1]

It thus contains a Light and a LightOblique font (with the weight set to 1.0f). However, when drawing with Java 2D, the Helvetica-Light output is obviously that of the *regular* Helvetica font. Deriving a new font from Font("Helvetica-Light") with weight 0.75 (or even less) does not change that behavior.

What do I have to do to make Java use the Helvetica-Light font correctly?

About | Sitemap | Contact