org.apache.batik.bridge
Class DefaultFontFamilyResolver

java.lang.Object
  extended by org.apache.batik.bridge.DefaultFontFamilyResolver
All Implemented Interfaces:
FontFamilyResolver

public final class DefaultFontFamilyResolver
extends Object
implements FontFamilyResolver

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


Field Summary
protected static List awtFontFamilies
           
protected static List awtFonts
           
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.
static DefaultFontFamilyResolver SINGLETON
           
 
Method Summary
 GVTFontFamily getDefault()
          
 GVTFontFamily getFamilyThatCanDisplay(char c)
          
 GVTFontFamily loadFont(InputStream in, FontFace ff)
           
 GVTFontFamily resolve(String familyName)
          Resolves a font family name into a GVTFontFamily.
 AWTFontFamily resolve(String familyName, FontFace fontFace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

public static final DefaultFontFamilyResolver SINGLETON

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.

Method Detail

resolve

public AWTFontFamily resolve(String familyName,
                             FontFace fontFace)
Specified by:
resolve in interface FontFamilyResolver

loadFont

public GVTFontFamily loadFont(InputStream in,
                              FontFace ff)
                       throws Exception
Specified by:
loadFont in interface FontFamilyResolver
Throws:
Exception

resolve

public GVTFontFamily resolve(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 interface FontFamilyResolver
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 interface FontFamilyResolver

getDefault

public GVTFontFamily getDefault()

Specified by:
getDefault in interface FontFamilyResolver


Copyright © 2017 Apache Software Foundation. All Rights Reserved.