Package org.apache.batik.bridge
Class DefaultFontFamilyResolver
- java.lang.Object
-
- org.apache.batik.bridge.DefaultFontFamilyResolver
-
- All Implemented Interfaces:
FontFamilyResolver
public final class DefaultFontFamilyResolver extends java.lang.Object implements FontFamilyResolver
The is a utility class that is used for resolving UnresolvedFontFamilies.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List
awtFontFamilies
protected static java.util.List
awtFonts
protected static java.util.Map
fonts
List of all available fonts on the current system, plus a few common alternatives.protected static java.util.Map
resolvedFontFamilies
This keeps track of all the resolved font families.static DefaultFontFamilyResolver
SINGLETON
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GVTFontFamily
getDefault()
GVTFontFamily
getFamilyThatCanDisplay(char c)
GVTFontFamily
loadFont(java.io.InputStream in, FontFace ff)
GVTFontFamily
resolve(java.lang.String familyName)
Resolves a font family name into a GVTFontFamily.AWTFontFamily
resolve(java.lang.String familyName, FontFace fontFace)
-
-
-
Field Detail
-
SINGLETON
public static final DefaultFontFamilyResolver SINGLETON
-
fonts
protected static final java.util.Map fonts
List of all available fonts on the current system, plus a few common alternatives.
-
awtFontFamilies
protected static final java.util.List awtFontFamilies
-
awtFonts
protected static final java.util.List awtFonts
-
resolvedFontFamilies
protected static final java.util.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
-
resolve
public AWTFontFamily resolve(java.lang.String familyName, FontFace fontFace)
- Specified by:
resolve
in interfaceFontFamilyResolver
-
loadFont
public GVTFontFamily loadFont(java.io.InputStream in, FontFace ff) throws java.lang.Exception
- Specified by:
loadFont
in interfaceFontFamilyResolver
- Throws:
java.lang.Exception
-
resolve
public GVTFontFamily resolve(java.lang.String familyName)
Resolves a font family name into a GVTFontFamily. If the font family cannot be resolved then null will be returned.- Specified by:
resolve
in interfaceFontFamilyResolver
- Parameters:
familyName
- The Font Family name to resolve- Returns:
- A resolved GVTFontFamily or null if the font family could not be resolved.
-
getFamilyThatCanDisplay
public GVTFontFamily getFamilyThatCanDisplay(char c)
- Specified by:
getFamilyThatCanDisplay
in interfaceFontFamilyResolver
-
getDefault
public GVTFontFamily getDefault()
- Specified by:
getDefault
in interfaceFontFamilyResolver
-
-