public class ITextFontResolver extends Object implements FontResolver
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ITextFontResolver.FontDescription |
| 构造器和说明 |
|---|
ITextFontResolver(SharedContext sharedContext) |
| 限定符和类型 | 方法和说明 |
|---|---|
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) |
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.docx4j.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 在接口中 FontResolverpublic void flushCache()
flushCache 在接口中 FontResolverpublic void flushFontFaceFonts()
public void importFontFaces(List fontFaces)
public void addFontDirectory(String dir, boolean embedded) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentExceptionIOExceptionpublic void addFont(String path, boolean embedded) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentExceptionIOExceptionpublic void addFont(String path, String encoding, boolean embedded) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentExceptionIOExceptionpublic void addFont(String path, String encoding, boolean embedded, String pathToPFB) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentExceptionIOExceptionpublic void addFont(String path, String fontFamilyNameOverride, String encoding, boolean embedded, String pathToPFB) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentExceptionIOExceptionpublic org.docx4j.org.xhtmlrenderer.pdf.ITextFontResolver.FontFamily getFontFamily(String fontFamilyName)
protected static String getHashName(String name, IdentValue weight, IdentValue style)
Copyright © 2019. All Rights Reserved.