public class ITextFontResolver extends Object implements FontResolver
| Modifier and Type | Class and Description |
|---|---|
static class |
ITextFontResolver.FontDescription |
| Constructor and Description |
|---|
ITextFontResolver(SharedContext sharedContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFont(String path,
boolean embedded) |
void |
addFont(String path,
String encoding,
boolean embedded) |
void |
addFont(String path,
String encoding,
boolean embedded,
String pathToPFB) |
void |
addFont(String path,
String fontFamilyNameOverride,
String encoding,
boolean embedded,
String pathToPFB) |
void |
addFontDirectory(String dir,
boolean embedded) |
static int |
convertWeightToInt(IdentValue weight) |
void |
flushCache() |
void |
flushFontFaceFonts() |
static Set |
getDistinctFontFamilyNames(String path,
String encoding,
boolean embedded)
Utility method which uses iText libraries to determine the family name(s) for the font at the given path.
|
org.xhtmlrenderer.pdf.ITextFontResolver.FontFamily |
getFontFamily(String fontFamilyName) |
protected static String |
getHashName(String name,
IdentValue weight,
IdentValue style) |
void |
importFontFaces(List fontFaces) |
FSFont |
resolveFont(SharedContext renderingContext,
FontSpecification spec) |
public ITextFontResolver(SharedContext sharedContext)
public static Set getDistinctFontFamilyNames(String path, String encoding, boolean embedded)
path - local path to the font fileencoding - same as what you would use for addFont(String, String, boolean)embedded - same as what you would use for addFont(String, String, boolean)public FSFont resolveFont(SharedContext renderingContext, FontSpecification spec)
resolveFont in interface FontResolverpublic void flushCache()
flushCache in interface FontResolverpublic void flushFontFaceFonts()
public void importFontFaces(List fontFaces)
public void addFontDirectory(String dir, boolean embedded) throws com.itextpdf.text.DocumentException, IOException
com.itextpdf.text.DocumentExceptionIOExceptionpublic void addFont(String path, boolean embedded) throws com.itextpdf.text.DocumentException, IOException
com.itextpdf.text.DocumentExceptionIOExceptionpublic void addFont(String path, String encoding, boolean embedded) throws com.itextpdf.text.DocumentException, IOException
com.itextpdf.text.DocumentExceptionIOExceptionpublic void addFont(String path, String encoding, boolean embedded, String pathToPFB) throws com.itextpdf.text.DocumentException, IOException
com.itextpdf.text.DocumentExceptionIOExceptionpublic void addFont(String path, String fontFamilyNameOverride, String encoding, boolean embedded, String pathToPFB) throws com.itextpdf.text.DocumentException, IOException
com.itextpdf.text.DocumentExceptionIOExceptionpublic org.xhtmlrenderer.pdf.ITextFontResolver.FontFamily getFontFamily(String fontFamilyName)
public static int convertWeightToInt(IdentValue weight)
protected static String getHashName(String name, IdentValue weight, IdentValue style)
Copyright © 2018. All rights reserved.