Package org.apache.batik.bridge
Class DefaultFontFamilyResolver
java.lang.Object
org.apache.batik.bridge.DefaultFontFamilyResolver
- All Implemented Interfaces:
FontFamilyResolver
The is a utility class that is used for resolving UnresolvedFontFamilies.
- Version:
- $Id: DefaultFontFamilyResolver.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final List
protected static final List
private static final AWTFontFamily
The default font.protected static final Map
List of all available fonts on the current system, plus a few common alternatives.protected static final Map
This keeps track of all the resolved font families.static final DefaultFontFamilyResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFamilyThatCanDisplay
(char c) loadFont
(InputStream in, FontFace ff) Resolves a font family name into a GVTFontFamily.
-
Field Details
-
SINGLETON
-
DEFAULT_FONT_FAMILY
The default font. This will be used when no font families can be resolved for a particular text chunk/run. -
fonts
List of all available fonts on the current system, plus a few common alternatives. -
awtFontFamilies
-
awtFonts
-
resolvedFontFamilies
This keeps track of all the resolved font families. This is to hopefully reduce the number of font family objects used.
-
-
Constructor Details
-
DefaultFontFamilyResolver
private DefaultFontFamilyResolver()
-
-
Method Details
-
resolve
- Specified by:
resolve
in interfaceFontFamilyResolver
-
loadFont
- Specified by:
loadFont
in interfaceFontFamilyResolver
- Throws:
Exception
-
resolve
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
- Specified by:
getFamilyThatCanDisplay
in interfaceFontFamilyResolver
-
getDefault
- Specified by:
getDefault
in interfaceFontFamilyResolver
-