Class PDFFontFactory

  • All Implemented Interfaces:
    FontFactory

    public class PDFFontFactory
    extends java.lang.Object
    implements FontFactory
    PDFFontFactory.java
    • Constructor Detail

      • PDFFontFactory

        public PDFFontFactory()
    • Method Detail

      • getFont

        public java.awt.Font getFont​(java.util.Map fontDict,
                                     PDFFile srcfile)
        Given a Font dictionary with keys and values as described in the pdf spec, return a java.awt.Font to use for it.
        Specified by:
        getFont in interface FontFactory
      • getFont

        public java.awt.Font getFont​(java.lang.String name,
                                     java.lang.String type)
        Look on the system for a font with the given name.
        Specified by:
        getFont in interface FontFactory
      • getSubstituteFont

        public java.awt.Font getSubstituteFont​(java.util.Map fontDict)
        Try some font substitutions.
        Specified by:
        getSubstituteFont in interface FontFactory
      • getDefaultFont

        public java.awt.Font getDefaultFont()
        When all else fails, use this font. Damn well better return something.
        Specified by:
        getDefaultFont in interface FontFactory
      • getGlyphMapper

        public GlyphMapper getGlyphMapper​(java.util.Map fontDict,
                                          PDFFile srcfile)
        Create a glyphmapper for the font specified by the pdf font dictionary
        Specified by:
        getGlyphMapper in interface FontFactory
      • getGlyphWidths

        public java.lang.Object getGlyphWidths​(java.util.Map fontDict,
                                               PDFFile srcfile)
        Returns the widths for all glyphs in the fonts. Return value is either a float[] for simple single-byte fonts or an instance of a PDFGlyphWidthTable for multi-byte or CID fonts.
        Specified by:
        getGlyphWidths in interface FontFactory