Package org.apache.fop.fonts.type1
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 EmbeddingMode
private final FontUris
private static final org.apache.commons.logging.Log
private SingleByteFont
Fields inherited from class org.apache.fop.fonts.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 void
Adds characters not encoded in the font's primary encoding.private void
Adds characters not encoded in the font's primary encoding.private static void
addUnencodedCharacter
(SingleByteFont font, AFMCharMetrics metrics) private CodePointMapping
buildCustomEncoding
(String encodingName, AFMFile afm) private void
private String
private void
handleEncoding
(AFMFile afm, PFMFile pfm) private void
handleFontName
(AFMFile afm, PFMFile pfm) private void
handleMetrics
(AFMFile afm, PFMFile pfm) protected void
read()
Reads/parses the font data.toGlyphSet
(String[] glyphNames) Methods inherited from class org.apache.fop.fonts.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:
read
in 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
-