Package com.ribs.pdf

Class PDFFontFactory

java.lang.Object
com.ribs.pdf.PDFFontFactory
All Implemented Interfaces:
FontFactory

public class PDFFontFactory extends Object implements FontFactory
PDFFontFactory.java
  • Constructor Details

    • PDFFontFactory

      public PDFFontFactory()
  • Method Details

    • getFont

      public Font getFont(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 Font getFont(String name, String type)
      Look on the system for a font with the given name.
      Specified by:
      getFont in interface FontFactory
    • getSubstituteFont

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

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

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

      public Object getGlyphWidths(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