Class Type1FontLoader
java.lang.Object
org.apache.fop.fonts.FontLoader
org.apache.fop.fonts.type1.Type1FontLoader
Loads a Type 1 font into memory directly from the original font file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private EmbeddingModeprivate final FontUrisprivate static final org.apache.commons.logging.Logprivate SingleByteFontFields inherited from class FontLoader
embedded, fontFileURI, loaded, resourceResolver, returnFont, useAdvanced, useKerning -
Constructor Summary
ConstructorsConstructorDescriptionType1FontLoader(FontUris fontUris, boolean embedded, EmbeddingMode embeddingMode, boolean useKerning, InternalResourceResolver resourceResolver) Constructs a new Type 1 font loader. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdds characters not encoded in the font's primary encoding.private voidAdds characters not encoded in the font's primary encoding.private static voidaddUnencodedCharacter(SingleByteFont font, AFMCharMetrics metrics) private CodePointMappingbuildCustomEncoding(String encodingName, AFMFile afm) private voidprivate Stringprivate voidhandleEncoding(AFMFile afm, PFMFile pfm) private voidhandleFontName(AFMFile afm, PFMFile pfm) private voidhandleMetrics(AFMFile afm, PFMFile pfm) protected voidread()Reads/parses the font data.toGlyphSet(String[] glyphNames) Methods inherited from class FontLoader
getFont, loadFont
-
Field Details
-
log
private static final org.apache.commons.logging.Log log -
singleFont
-
embeddingMode
-
fontUris
-
AFM_EXTENSIONS
-
-
Constructor Details
-
Type1FontLoader
public Type1FontLoader(FontUris fontUris, boolean embedded, EmbeddingMode embeddingMode, boolean useKerning, InternalResourceResolver resourceResolver) throws IOException Constructs a new Type 1 font loader.- Parameters:
fontUris- the URI to the PFB file of a Type 1 fontembedded- indicates whether the font is embedded or referenceduseKerning- indicates whether to load kerning information if availableresourceResolver- the font resolver used to resolve URIs- Throws:
IOException- In case of an I/O error
-
-
Method Details
-
getPFMURI
-
read
Reads/parses the font data.- Specified by:
readin classFontLoader- Throws:
IOException- In case of an I/O error
-
buildFont
-
handleEncoding
-
toGlyphSet
-
addUnencodedBasedOnEncoding
Adds characters not encoded in the font's primary encoding. This method is used when we don't trust the AFM to expose the same encoding as the primary font.- Parameters:
afm- the AFM file.
-
addUnencodedCharacter
-
addUnencodedBasedOnAFM
Adds characters not encoded in the font's primary encoding. This method is used when the primary encoding is built based on the character codes in the AFM rather than the specified encoding (ex. with symbolic fonts).- Parameters:
afm- the AFM file
-
handleFontName
-
handleMetrics
-
buildCustomEncoding
-