Class Type1FontLoader


  • public class Type1FontLoader
    extends FontLoader
    Loads a Type 1 font into memory directly from the original font file.
    • Field Detail

      • log

        private static final org.apache.commons.logging.Log log
      • 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 font
        embedded - indicates whether the font is embedded or referenced
        useKerning - indicates whether to load kerning information if available
        resourceResolver - 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.IOException
        Reads/parses the font data.
        Specified by:
        read in class FontLoader
        Throws:
        java.io.IOException - In case of an I/O error
      • handleEncoding

        private void handleEncoding​(AFMFile afm,
                                    PFMFile pfm)
      • 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.
      • 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
      • handleFontName

        private void handleFontName​(AFMFile afm,
                                    PFMFile pfm)
      • handleMetrics

        private void handleMetrics​(AFMFile afm,
                                   PFMFile pfm)
      • buildCustomEncoding

        private CodePointMapping buildCustomEncoding​(java.lang.String encodingName,
                                                     AFMFile afm)