public class FontManager extends Object
Constructor and Description |
---|
FontManager(InternalResourceResolver resourceResolver,
FontDetector fontDetector,
FontCacheManager fontCacheManager)
Main constructor
|
Modifier and Type | Method and Description |
---|---|
void |
autoDetectFonts(boolean autoDetectFonts,
FontAdder fontAdder,
boolean strict,
FontEventListener listener,
List<EmbedFontInfo> fontInfoList)
Detect fonts from the operating system via FOPs autodetect mechanism.
|
void |
deleteCache()
Deletes the current FontCache file
|
void |
disableFontCache()
Whether or not to cache results of font triplet detection/auto-config
|
FontCache |
getFontCache()
Returns the font cache instance used by this font manager.
|
protected FontSubstitutions |
getFontSubstitutions()
Returns the font substitution catalog
|
FontTriplet.Matcher |
getReferencedFontsMatcher()
Gets the
FontTriplet.Matcher that can be used to identify the fonts that shall
be referenced rather than embedded. |
InternalResourceResolver |
getResourceResolver() |
boolean |
isBase14KerningEnabled() |
void |
saveCache()
Saves the FontCache as necessary
|
void |
setBase14KerningEnabled(boolean value)
Controls whether kerning is activated on base 14 fonts.
|
void |
setCacheFile(URI cacheFileURI)
Sets the font cache file
|
void |
setFontSubstitutions(FontSubstitutions substitutions)
Sets the font substitutions
|
void |
setReferencedFontsMatcher(FontTriplet.Matcher matcher)
Sets the
FontTriplet.Matcher that can be used to identify the fonts that shall
be referenced rather than embedded. |
void |
setResourceResolver(InternalResourceResolver resourceResolver)
Sets the font resource resolver
|
void |
setup(FontInfo fontInfo,
FontCollection[] fontCollections)
Sets up the fonts on a given FontInfo object.
|
void |
updateReferencedFonts(List<EmbedFontInfo> fontInfoList)
Updates the referenced font list using the FontManager's referenced fonts matcher
(
getReferencedFontsMatcher() ). |
void |
updateReferencedFonts(List<EmbedFontInfo> fontInfoList,
FontTriplet.Matcher matcher)
Updates the referenced font list.
|
public FontManager(InternalResourceResolver resourceResolver, FontDetector fontDetector, FontCacheManager fontCacheManager)
resourceResolver
- the URI resolverfontDetector
- the font detectorfontCacheManager
- the font cache managerpublic void setResourceResolver(InternalResourceResolver resourceResolver)
resourceResolver
- resource resolverpublic InternalResourceResolver getResourceResolver()
public boolean isBase14KerningEnabled()
public void setBase14KerningEnabled(boolean value)
value
- true if kerning should be activatedpublic void setFontSubstitutions(FontSubstitutions substitutions)
substitutions
- font substitutionsprotected FontSubstitutions getFontSubstitutions()
public void setCacheFile(URI cacheFileURI)
cacheFileURI
- the URI of the font cache filepublic void disableFontCache()
public FontCache getFontCache()
public void saveCache() throws FOPException
FOPException
- fop exceptionpublic void deleteCache() throws FOPException
FOPException
- if an error was thrown while deleting the cachepublic void setup(FontInfo fontInfo, FontCollection[] fontCollections)
FontCollection
objects.fontInfo
- the FontInfo object to set upfontCollections
- the array of font collections/sourcespublic void setReferencedFontsMatcher(FontTriplet.Matcher matcher)
FontTriplet.Matcher
that can be used to identify the fonts that shall
be referenced rather than embedded.matcher
- the font triplet matcherpublic FontTriplet.Matcher getReferencedFontsMatcher()
FontTriplet.Matcher
that can be used to identify the fonts that shall
be referenced rather than embedded.public void updateReferencedFonts(List<EmbedFontInfo> fontInfoList)
getReferencedFontsMatcher()
).fontInfoList
- a font info listpublic void updateReferencedFonts(List<EmbedFontInfo> fontInfoList, FontTriplet.Matcher matcher)
fontInfoList
- a font info listmatcher
- the font triplet matcher to usepublic void autoDetectFonts(boolean autoDetectFonts, FontAdder fontAdder, boolean strict, FontEventListener listener, List<EmbedFontInfo> fontInfoList) throws FOPException
autoDetectFonts
- if autodetect has been enabledfontAdder
- the font adding mechanismstrict
- whether to enforce strict validationlistener
- the listener for font related eventsfontInfoList
- a list of font info objectsFOPException
- if an exception was thrown auto-detecting fontsCopyright © 2025 Apache Software Foundation. All rights reserved.