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 Details

    • 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 String[] 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 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:
      IOException - In case of an I/O error
  • Method Details

    • getPFMURI

      private String getPFMURI(String pfbURI)
    • read

      protected void read() throws IOException
      Reads/parses the font data.
      Specified by:
      read in class FontLoader
      Throws:
      IOException - In case of an I/O error
    • buildFont

      private void buildFont(AFMFile afm, PFMFile pfm)
    • handleEncoding

      private void handleEncoding(AFMFile afm, PFMFile pfm)
    • toGlyphSet

      private Set<String> toGlyphSet(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
    • handleFontName

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

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

      private CodePointMapping buildCustomEncoding(String encodingName, AFMFile afm)