Class Java2DFontResolver
java.lang.Object
com.openhtmltopdf.java2d.Java2DFontResolver
- All Implemented Interfaces:
FontResolver
REsolves an AWT font instance from a list of CSS font families and characteristics.
- Author:
- Joshua Marinacci
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFontFile(File fontFile, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride) Add a font using a existing file.voidaddInputStreamFont(FSSupplier<InputStream> fontSupplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride) 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.voidDeprecated.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.voidimportFontFaces(List<FontFaceRule> fontFaces) resolveFont(SharedContext renderingContext, FontSpecification spec) resolveFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant) Resolves a list of font families.voidsetFontMapping(String name, Font font) Sets the fontMapping attribute of the FontResolver object
-
Constructor Details
-
Method Details
-
flushCache
Deprecated. -
importFontFaces
-
addInputStreamFont
public void addInputStreamFont(FSSupplier<InputStream> fontSupplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride) -
addFontFile
public void addFontFile(File fontFile, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride) Add a font using a existing file. Does not handle true type collections. -
setFontMapping
-