Class PDFFontFactory
- java.lang.Object
-
- com.inductiveautomation.rm.pdf.reader.PDFFontFactory
-
- All Implemented Interfaces:
FontFactory
public class PDFFontFactory extends java.lang.Object implements FontFactory
PDFFontFactory.java
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.rm.pdf.reader.FontFactory
AdobeCIDType0Font, AdobeCIDType2Font, AdobeMultipleMasterFont, AdobeType0Font, AdobeType1Font, AdobeType3Font, TrueTypeFont, UnknownFontType
-
-
Constructor Summary
Constructors Constructor Description PDFFontFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Font
getDefaultFont()
When all else fails, use this font.java.awt.Font
getFont(java.lang.String name, java.lang.String type)
Look on the system for a font with the given name.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.GlyphMapper
getGlyphMapper(java.util.Map fontDict, PDFFile srcfile)
Create a glyphmapper for the font specified by the pdf font dictionaryjava.lang.Object
getGlyphWidths(java.util.Map fontDict, PDFFile srcfile)
Returns the widths for all glyphs in the fonts.java.awt.Font
getSubstituteFont(java.util.Map fontDict)
Try some font substitutions.
-
-
-
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 interfaceFontFactory
-
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 interfaceFontFactory
-
getSubstituteFont
public java.awt.Font getSubstituteFont(java.util.Map fontDict)
Try some font substitutions.- Specified by:
getSubstituteFont
in interfaceFontFactory
-
getDefaultFont
public java.awt.Font getDefaultFont()
When all else fails, use this font. Damn well better return something.- Specified by:
getDefaultFont
in interfaceFontFactory
-
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 interfaceFontFactory
-
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 interfaceFontFactory
-
-