Class PDType1FontEmbedder


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

      • fontEncoding

        private final Encoding fontEncoding
    • Constructor Detail

      • PDType1FontEmbedder

        PDType1FontEmbedder​(PDDocument doc,
                            COSDictionary dict,
                            java.io.InputStream pfbStream,
                            Encoding encoding)
                     throws java.io.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:
        java.io.IOException - If there is an error loading the data.
    • Method Detail

      • 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.