Class OFFontLoader
java.lang.Object
org.apache.fop.fonts.FontLoader
org.apache.fop.fonts.truetype.OFFontLoader
Loads a TrueType font into memory directly from the original font file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate EmbeddingModeprivate EncodingModeprivate MultiByteFontprivate booleanprivate SingleByteFontprivate final Stringprivate booleanFields inherited from class FontLoader
embedded, fontFileURI, loaded, log, resourceResolver, returnFont, useAdvanced, useKerning -
Constructor Summary
ConstructorsConstructorDescriptionOFFontLoader(URI fontFileURI, String subFontName, boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning, boolean useAdvanced, InternalResourceResolver resolver, boolean simulateStyle, boolean embedAsType1, boolean useSVG) Additional constructor for TrueType Collections.OFFontLoader(URI fontFileURI, InternalResourceResolver resourceResolver) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcopyAdvanced(OpenFont otf) Copy advanced typographic information.private voidprivate voidcopyKerning(OpenFont otf, boolean isCid) Copy kerning information.private CMapSegment[]protected voidread()Reads/parses the font data.private voidReads a TrueType font.static StringreadHeader(FontFileReader fontFile) Methods inherited from class FontLoader
getFont, loadFont
-
Field Details
-
multiFont
-
singleFont
-
subFontName
-
encodingMode
-
embeddingMode
-
simulateStyle
private boolean simulateStyle -
embedAsType1
private boolean embedAsType1 -
useSVG
private boolean useSVG
-
-
Constructor Details
-
OFFontLoader
Default constructor- Parameters:
fontFileURI- the URI representing the font fileresourceResolver- the resource resolver for font URI resolution
-
OFFontLoader
public OFFontLoader(URI fontFileURI, String subFontName, boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning, boolean useAdvanced, InternalResourceResolver resolver, boolean simulateStyle, boolean embedAsType1, boolean useSVG) Additional constructor for TrueType Collections.- Parameters:
fontFileURI- the URI representing the font filesubFontName- the sub-fontname of a font in a TrueType Collection (or null for normal TrueType fonts)embedded- indicates whether the font is embedded or referencedembeddingMode- the embedding mode of the fontencodingMode- the requested encoding modeuseKerning- true to enable loading kerning info if available, false to disableuseAdvanced- true to enable loading advanced info if available, false to disableresolver- the FontResolver for font URI resolutionsimulateStyle- Determines whether to simulate font styles if a font does not support those by default.
-
-
Method Details
-
read
Reads/parses the font data.- Specified by:
readin classFontLoader- Throws:
IOException- In case of an I/O error
-
read
Reads a TrueType font.- Parameters:
ttcFontName- the TrueType sub-font name of TrueType Collection (may be null for normal TrueType fonts)- Throws:
IOException- if an I/O error occurs
-
readHeader
- Throws:
IOException
-
buildFont
-
getCMap
-
copyGlyphMetricsSingleByte
-
copyKerning
Copy kerning information. -
copyAdvanced
Copy advanced typographic information.
-