Class awt.FontTable
All Packages    This Package    Previous    Next

Class awt.FontTable

java.lang.Object
   |
   +----awt.FontTable

public class FontTable
extends Object
A class that creates native fonts. Fonts are addressed by names in the FontTable. These names may not be the actual name of the font. By default, the names "Helvetica", "TimesRoman", "ZapfDingbats", "Dialog", "DialogInput", and "Courier" are always available. "Dialog" is bound to a native font that is appropriate for dialog components such as buttons or menus. In each font category, the sizes 8, 10, 12, 14, 24, 36 are always available. Other sizes may be specified and will work if the requested font is bound to a scalable font on the local platform or if the platform can do font-scaling. If scaling is not available, then the closest match is returned.
Version:
1.10 31 Jan 1995
Author:
Sami Shaio

FontTable(WServer)

addMapping(String, String)
Add a mapping from a generic name to a native fontname.
compoundName(String, int, int)
Returns a string representation of a font-name, style and height.
getFont(String, int, int)
Return a platform-specific font given a generic name.
getFont(String)
Return a platform-specific font given a name of the form :style:size where style can be "plain", "bold", "italic" or "bolditalic".
getNativeFont(int)
Return the name of the native font with the given index.
getNativeFontCount()
List the number of fonts on the native platform.
mapName(String)
Map a generic font name to the native font it represents.
parseCompoundName(String)

FontTable
  public FontTable(WServer ws)

getFont
  public Font getFont(String name,
                      int style,
                      int height)
Return a platform-specific font given a generic name. See Font class for the appropriate values for style.

getFont

  public Font getFont(String compoundName)
Return a platform-specific font given a name of the form :style:size where style can be "plain", "bold", "italic" or "bolditalic".

mapName

  public synchronized String mapName(String genName)
Map a generic font name to the native font it represents.

addMapping

  public synchronized void addMapping(String genName,
                                      String platformName)
Add a mapping from a generic name to a native fontname. Passing in null for platformName clears the mapping.

getNativeFontCount

  public int getNativeFontCount()
List the number of fonts on the native platform.

getNativeFont

  public String getNativeFont(int index)
Return the name of the native font with the given index.

compoundName

  public String compoundName(String name,
                             int style,
                             int height)
Returns a string representation of a font-name, style and height.

parseCompoundName

  public static FontSpec parseCompoundName(String cname)

All Packages    This Package    Previous    Next