public class ITextFontResolver extends Object implements org.xhtmlrenderer.extend.FontResolver
| Constructor and Description |
|---|
ITextFontResolver() |
ITextFontResolver(org.xhtmlrenderer.layout.SharedContext sharedContext)
Deprecated.
Use default constructor (sharedContext is not used anymore by this class)
|
ITextFontResolver(org.xhtmlrenderer.layout.SharedContext sharedContext,
boolean withCjkfonts)
Deprecated.
Use default constructor
|
| 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(org.xhtmlrenderer.css.constants.IdentValue weight) |
void |
flushCache() |
void |
flushFontFaceFonts() |
static Set<String> |
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.
|
Map<String,FontFamily> |
getFonts() |
protected static String |
getHashName(String name,
org.xhtmlrenderer.css.constants.IdentValue weight,
org.xhtmlrenderer.css.constants.IdentValue style) |
void |
importFontFaces(List<org.xhtmlrenderer.css.sheet.FontFaceRule> fontFaces,
org.xhtmlrenderer.extend.UserAgentCallback userAgentCallback) |
protected Map<String,FontFamily> |
loadFonts() |
org.xhtmlrenderer.render.FSFont |
resolveFont(org.xhtmlrenderer.layout.SharedContext renderingContext,
org.xhtmlrenderer.css.value.FontSpecification spec) |
public ITextFontResolver()
@Deprecated public ITextFontResolver(org.xhtmlrenderer.layout.SharedContext sharedContext)
@Deprecated public ITextFontResolver(org.xhtmlrenderer.layout.SharedContext sharedContext, boolean withCjkfonts)
sharedContext - not needed in constructor anymorewithCjkfonts - instead of passing this parameter, please use subclass CJKFontResolverpublic Map<String,FontFamily> getFonts()
public static Set<String> 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 org.xhtmlrenderer.render.FSFont resolveFont(org.xhtmlrenderer.layout.SharedContext renderingContext,
org.xhtmlrenderer.css.value.FontSpecification spec)
resolveFont in interface org.xhtmlrenderer.extend.FontResolverpublic void flushCache()
flushCache in interface org.xhtmlrenderer.extend.FontResolverpublic void flushFontFaceFonts()
public void importFontFaces(List<org.xhtmlrenderer.css.sheet.FontFaceRule> fontFaces, org.xhtmlrenderer.extend.UserAgentCallback userAgentCallback)
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 static int convertWeightToInt(org.xhtmlrenderer.css.constants.IdentValue weight)
protected static String getHashName(String name, org.xhtmlrenderer.css.constants.IdentValue weight, org.xhtmlrenderer.css.constants.IdentValue style)
protected Map<String,FontFamily> loadFonts()
Copyright © 2023. All rights reserved.