OFFontLoader
, Type1FontLoader
public abstract class FontLoader
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
embedded |
true if the font will be embedded, false if it will be referenced only.
|
protected java.net.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 | Description |
---|---|
FontLoader(java.net.URI fontFileURI,
boolean embedded,
boolean useKerning,
boolean useAdvanced,
InternalResourceResolver resourceResolver) |
Default constructor.
|
Modifier and Type | Method | Description |
---|---|---|
CustomFont |
getFont() |
Returns the custom font that was read using this instance of FontLoader.
|
static CustomFont |
loadFont(FontUris fontUris,
java.lang.String subFontName,
boolean embedded,
EmbeddingMode embeddingMode,
EncodingMode encodingMode,
boolean useKerning,
boolean useAdvanced,
InternalResourceResolver resourceResolver) |
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 java.net.URI fontFileURI
protected final InternalResourceResolver resourceResolver
protected CustomFont returnFont
protected boolean loaded
protected boolean embedded
protected boolean useKerning
protected boolean useAdvanced
public FontLoader(java.net.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, java.lang.String subFontName, boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning, boolean useAdvanced, InternalResourceResolver resourceResolver) throws java.io.IOException
fontFileURI
- 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 URIsjava.io.IOException
- In case of an I/O errorprotected abstract void read() throws java.io.IOException
java.io.IOException
- In case of an I/O errorpublic CustomFont getFont() throws java.io.IOException
java.io.IOException
- if an I/O error occursCopyright 1999-2016 The Apache Software Foundation. All Rights Reserved.