Symbian
Symbian OS Library

FAQ-0428 The fonts in my Java UI components seem too small. Why is this?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: AWT
Created: 11/02/99 Modified: 06/22/2001
Number: FAQ-0428
Platform: ER5

Question:
The fonts in my Java UI components seem too small. Why is this?

Answer:
This is a known issue with the ER5 EPOC Runtime for Java. Font sizes are specified in java.awt.Font.size in points. In the native EPOC implementation font sizes are specified in twips, whence the Java sizes should simply be multiplied by 20. Unfortunately, the conversion to twips was implemented using MGraphicsDeviceMap::VerticalPixelsToTwips(TInt fontSize), which assumes that fontSize is specified in pixels, not points. So instead of being multiplied by 20, the point sizes of the Java-specified fonts get multiplied by a device-dependent factor. As the height of a Series 5mx 1/2 VGA screen is 144 points corresponding to 240 pixels, the Java font sizes get multiplied by 20x144/240, i.e. 12, so they are rendered about 40% smaller than they would otherwise be.

The problem will be fixed in the next release of the EPOC Runtime for Java. In the meantime the only work around is to scale your Java font sizes up manually in the Java source code.