public abstract class FontLoader extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
embedded
true if the font will be embedded, false if it will be referenced only.
|
protected URI |
fontFileURI
URI representing the font file
|
protected boolean |
loaded
true if the font has been loaded
|
protected static org.apache.commons.logging.Log |
log
logging instance
|
protected InternalResourceResolver |
resourceResolver
the resource resolver to use for font URI resolution
|
protected CustomFont |
returnFont
the loaded font
|
protected boolean |
useAdvanced
true if advanced typographic information shall be loaded if available.
|
protected boolean |
useKerning
true if kerning information false be loaded if available.
|
Constructor and Description |
---|
FontLoader(URI fontFileURI,
boolean embedded,
boolean useKerning,
boolean useAdvanced,
InternalResourceResolver resourceResolver)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
CustomFont |
getFont()
Returns the custom font that was read using this instance of FontLoader.
|
static CustomFont |
loadFont(FontUris fontUris,
String subFontName,
boolean embedded,
EmbeddingMode embeddingMode,
EncodingMode encodingMode,
boolean useKerning,
boolean useAdvanced,
InternalResourceResolver resourceResolver,
boolean simulateStyle,
boolean embedAsType1,
boolean useSVG)
Loads a custom font from a URI.
|
protected abstract void |
read()
Reads/parses the font data.
|
protected static final org.apache.commons.logging.Log log
protected final URI fontFileURI
protected final InternalResourceResolver resourceResolver
protected CustomFont returnFont
protected boolean loaded
protected boolean embedded
protected boolean useKerning
protected boolean useAdvanced
public FontLoader(URI fontFileURI, boolean embedded, boolean useKerning, boolean useAdvanced, InternalResourceResolver resourceResolver)
fontFileURI
- the URI to the PFB file of a Type 1 fontembedded
- indicates whether the font is embedded or referenceduseKerning
- indicates whether kerning information shall be loaded if availableuseAdvanced
- indicates whether advanced typographic information shall be loaded if
availableresourceResolver
- the font resolver used to resolve URIspublic static CustomFont loadFont(FontUris fontUris, String subFontName, boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning, boolean useAdvanced, InternalResourceResolver resourceResolver, boolean simulateStyle, boolean embedAsType1, boolean useSVG) throws IOException
fontUris
- the URI to the fontsubFontName
- the sub-fontname of a font (for TrueType Collections, null otherwise)embedded
- indicates whether the font is embedded or referencedembeddingMode
- the embedding mode of the fontencodingMode
- the requested encoding modeuseKerning
- indicates whether kerning information should be loaded if availableuseAdvanced
- indicates whether advanced typographic information shall be loaded if
availableresourceResolver
- the font resolver to use when resolving URIsIOException
- In case of an I/O errorprotected abstract void read() throws IOException
IOException
- In case of an I/O errorpublic CustomFont getFont() throws IOException
IOException
- if an I/O error occursCopyright © 2025 Apache Software Foundation. All rights reserved.