Package com.ribs.pdf

Interface FontFactory

  • All Known Implementing Classes:
    PDFFontFactory

    public interface FontFactory
    • Method Detail

      • getFont

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

        java.awt.Font getFont​(java.lang.String name,
                              java.lang.String type)
        Look on the system for a font with the given name.
      • getSubstituteFont

        java.awt.Font getSubstituteFont​(java.util.Map fontDict)
        Try some font substitutions.
      • getDefaultFont

        java.awt.Font getDefaultFont()
        When all else fails, use this font. Damn well better return something.
      • getGlyphMapper

        GlyphMapper getGlyphMapper​(java.util.Map fontDict,
                                   PDFFile srcfile)
        Returns an instance of a GlyphMapper object which knows how to translate strings as they would appear in the pdf into a suitable encoding for the font. See GlyphMapper.java for more info.
      • getGlyphWidths

        java.lang.Object getGlyphWidths​(java.util.Map fontDict,
                                        PDFFile srcfile)
        Returns the array of widths for all glyphs in the font. PDF Requires this array to be in the font dictionary, except for the standard 14 fonts. Note that the array is indexed by character code, not glyph code as mapped through the encoding. Size of the width array in the dict is last-first+1 in the dictionary, but this routine should always return either an array of 256 chars or a PDFGlyphWidthTable for cid fonts.

        It should also do something reasonable if there is no width array (like for the standard 14) Also, width should be for 1 pt font (value in pdf width array/1000).