Package com.openhtmltopdf.swing
Class AWTFontResolver
java.lang.Object
com.openhtmltopdf.swing.AWTFontResolver
- All Implemented Interfaces:
FontResolver
public class AWTFontResolver extends Object implements FontResolver
REsolves an AWT font instance from a list of CSS font families and characteristics.
- Author:
- Joshua Marinacci
-
Constructor Summary
Constructors Constructor Description AWTFontResolver()Constructor -
Method Summary
Modifier and Type Method Description protected static FontcreateFont(SharedContext ctx, Font rootFont, float size, IdentValue weight, IdentValue style, IdentValue variant)Creates a concrete instance of a font at specified size, weight, style and variant.voidflushCache()protected static StringgetFontInstanceHashName(SharedContext ctx, String name, float size, IdentValue weight, IdentValue style, IdentValue variant)Gets the hash key for a concrete instance of a font.FSFontresolveFont(SharedContext renderingContext, FontSpecification spec)FSFontresolveFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant)Resolves a list of font families.protected FontresolveFont(SharedContext ctx, String font, float size, IdentValue weight, IdentValue style, IdentValue variant)Resolves a single font name.voidsetFontMapping(String name, Font font)Sets the fontMapping attribute of the FontResolver object
-
Constructor Details
-
AWTFontResolver
public AWTFontResolver()Constructor
-
-
Method Details
-
flushCache
public void flushCache()- Specified by:
flushCachein interfaceFontResolver
-
setFontMapping
Sets the fontMapping attribute of the FontResolver object- Parameters:
name- The new fontMapping valuefont- The new fontMapping value
-