org.apache.batik.gvt.font
Class FontFamilyResolver

java.lang.Object
  extended by org.apache.batik.gvt.font.FontFamilyResolver

public class FontFamilyResolver
extends Object

The is a utility class that is used for resolving UnresolvedFontFamilies.


Field Summary
protected static List awtFontFamilies
           
protected static List awtFonts
           
static AWTFontFamily defaultFont
          The default font.
protected static Map fonts
          List of all available fonts on the current system, plus a few common alternatives.
protected static Map resolvedFontFamilies
          This keeps track of all the resolved font families.
 
Constructor Summary
FontFamilyResolver()
           
 
Method Summary
static GVTFontFamily getFamilyThatCanDisplay(char c)
           
static String lookup(String familyName)
          Looks up a font family name and returns the platform name for the font.
static GVTFontFamily resolve(String familyName)
          Resolves a font family name into a GVTFontFamily.
static GVTFontFamily resolve(UnresolvedFontFamily fontFamily)
          Resolves an UnresolvedFontFamily into a GVTFontFamily.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultFont

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


fonts

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


awtFontFamilies

protected static final List awtFontFamilies

awtFonts

protected static final List awtFonts

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.

Constructor Detail

FontFamilyResolver

public FontFamilyResolver()
Method Detail

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.

getFamilyThatCanDisplay

public static GVTFontFamily getFamilyThatCanDisplay(char c)


Copyright © 2008 Apache Software Foundation. All Rights Reserved.