Class PDType1FontEmbedder

java.lang.Object
org.apache.pdfbox.pdmodel.font.PDType1FontEmbedder

class PDType1FontEmbedder extends Object
Embedded PDType1Font builder. Helper class to populate a PDType1Font from a PFB and AFM.
  • Field Details

    • fontEncoding

      private final Encoding fontEncoding
    • type1

      private final Type1Font type1
  • Constructor Details

    • PDType1FontEmbedder

      PDType1FontEmbedder(PDDocument doc, COSDictionary dict, InputStream pfbStream, Encoding encoding) throws IOException
      This will load a PFB to be embedded into a document.
      Parameters:
      doc - The PDF document that will hold the embedded font.
      dict - The Font dictionary to write to.
      pfbStream - The pfb input.
      Throws:
      IOException - If there is an error loading the data.
  • Method Details

    • buildFontDescriptor

      static PDFontDescriptor buildFontDescriptor(Type1Font type1)
      Returns a PDFontDescriptor for the given PFB.
    • buildFontDescriptor

      static PDFontDescriptor buildFontDescriptor(FontMetrics metrics)
      Returns a PDFontDescriptor for the given AFM. Used only for Standard 14 fonts.
      Parameters:
      metrics - AFM
    • getFontEncoding

      public Encoding getFontEncoding()
      Returns the font's encoding.
    • getGlyphList

      public GlyphList getGlyphList()
      Returns the font's glyph list.
    • getType1Font

      public Type1Font getType1Font()
      Returns the Type 1 font.