org.apache.batik.gvt.font

Class FontFamilyResolver

public class FontFamilyResolver extends Object

The is a utility class that is used for resolving UnresolvedFontFamilies.
Field Summary
protected static ListawtFontFamilies
protected static ListawtFonts
static AWTFontFamilydefaultFont
The default font.
protected static Mapfonts
List of all available fonts on the current system, plus a few common alternatives.
protected static MapresolvedFontFamilies
This keeps track of all the resolved font families.
Method Summary
static GVTFontFamilygetFamilyThatCanDisplay(char c)
static Stringlookup(String familyName)
Looks up a font family name and returns the platform name for the font.
static GVTFontFamilyresolve(String familyName)
Resolves a font family name into a GVTFontFamily.
static GVTFontFamilyresolve(UnresolvedFontFamily fontFamily)
Resolves an UnresolvedFontFamily into a GVTFontFamily.

Field Detail

awtFontFamilies

protected static final List awtFontFamilies

awtFonts

protected static final List awtFonts

defaultFont

public static final AWTFontFamily defaultFont
The default font. This will be used when no font families can be resolved for a particular text chunck/run.

fonts

protected static final Map fonts
List of all available fonts on the current system, plus a few common alternatives.

resolvedFontFamilies

protected static final Map resolvedFontFamilies
This keeps track of all the resolved font families. This is to hopefully reduce the number of font family objects used.

Method Detail

getFamilyThatCanDisplay

public static GVTFontFamily getFamilyThatCanDisplay(char c)

lookup

public static String lookup(String familyName)
Looks up a font family name and returns the platform name for the font.

Parameters: familyName The Font Family name to resolve

Returns: The platform name for the font or null if it can't be found.

resolve

public static GVTFontFamily resolve(String familyName)
Resolves a font family name into a GVTFontFamily. If the font family cannot be resolved then null will be returned.

Parameters: familyName The Font Family name to resolve

Returns: A resolved GVTFontFamily or null if the font family could not be resolved.

resolve

public static GVTFontFamily resolve(UnresolvedFontFamily fontFamily)
Resolves an UnresolvedFontFamily into a GVTFontFamily. If the font family cannot be resolved then null will be returned.

Parameters: fontFamily The UnresolvedFontFamily to resolve

Returns: A resolved GVTFontFamily or null if the font family could not be resolved.

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.