Package org.apache.fop.fonts.type1
Class Type1FontLoader
- java.lang.Object
-
- org.apache.fop.fonts.FontLoader
-
- org.apache.fop.fonts.type1.Type1FontLoader
-
public class Type1FontLoader extends FontLoader
Loads a Type 1 font into memory directly from the original font file.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]AFM_EXTENSIONSprivate EmbeddingModeembeddingModeprivate FontUrisfontUrisprivate static org.apache.commons.logging.Loglogprivate SingleByteFontsingleFont-
Fields inherited from class org.apache.fop.fonts.FontLoader
embedded, fontFileURI, loaded, resourceResolver, returnFont, useAdvanced, useKerning
-
-
Constructor Summary
Constructors Constructor Description Type1FontLoader(FontUris fontUris, boolean embedded, EmbeddingMode embeddingMode, boolean useKerning, InternalResourceResolver resourceResolver)Constructs a new Type 1 font loader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddUnencodedBasedOnAFM(AFMFile afm)Adds characters not encoded in the font's primary encoding.private voidaddUnencodedBasedOnEncoding(AFMFile afm)Adds characters not encoded in the font's primary encoding.private static voidaddUnencodedCharacter(SingleByteFont font, AFMCharMetrics metrics)private CodePointMappingbuildCustomEncoding(java.lang.String encodingName, AFMFile afm)private voidbuildFont(AFMFile afm, PFMFile pfm)private java.lang.StringgetPFMURI(java.lang.String pfbURI)private voidhandleEncoding(AFMFile afm, PFMFile pfm)private voidhandleFontName(AFMFile afm, PFMFile pfm)private voidhandleMetrics(AFMFile afm, PFMFile pfm)protected voidread()Reads/parses the font data.private java.util.Set<java.lang.String>toGlyphSet(java.lang.String[] glyphNames)-
Methods inherited from class org.apache.fop.fonts.FontLoader
getFont, loadFont
-
-
-
-
Field Detail
-
log
private static final org.apache.commons.logging.Log log
-
singleFont
private SingleByteFont singleFont
-
embeddingMode
private EmbeddingMode embeddingMode
-
fontUris
private final FontUris fontUris
-
AFM_EXTENSIONS
private static final java.lang.String[] AFM_EXTENSIONS
-
-
Constructor Detail
-
Type1FontLoader
public Type1FontLoader(FontUris fontUris, boolean embedded, EmbeddingMode embeddingMode, boolean useKerning, InternalResourceResolver resourceResolver) throws java.io.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:
java.io.IOException- In case of an I/O error
-
-
Method Detail
-
getPFMURI
private java.lang.String getPFMURI(java.lang.String pfbURI)
-
read
protected void read() throws java.io.IOExceptionReads/parses the font data.- Specified by:
readin classFontLoader- Throws:
java.io.IOException- In case of an I/O error
-
toGlyphSet
private java.util.Set<java.lang.String> toGlyphSet(java.lang.String[] glyphNames)
-
addUnencodedBasedOnEncoding
private void addUnencodedBasedOnEncoding(AFMFile afm)
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
private static void addUnencodedCharacter(SingleByteFont font, AFMCharMetrics metrics)
-
addUnencodedBasedOnAFM
private void addUnencodedBasedOnAFM(AFMFile afm)
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
-
buildCustomEncoding
private CodePointMapping buildCustomEncoding(java.lang.String encodingName, AFMFile afm)
-
-