Package com.ribs.pdf
Interface FontFactory
-
- All Known Implementing Classes:
PDFFontFactory
public interface FontFactory
-
-
Field Summary
Fields Modifier and Type Field Description static int
AdobeCIDType0Font
static int
AdobeCIDType2Font
static int
AdobeMultipleMasterFont
static int
AdobeType0Font
Constants used to identify embedded font typesstatic int
AdobeType1Font
static int
AdobeType3Font
static int
TrueTypeFont
static int
UnknownFontType
-
Method Summary
All Methods Instance Methods Abstract 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)
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.java.lang.Object
getGlyphWidths(java.util.Map fontDict, PDFFile srcfile)
Returns the array of widths for all glyphs in the font.java.awt.Font
getSubstituteFont(java.util.Map fontDict)
Try some font substitutions.
-
-
-
Field Detail
-
AdobeType0Font
static final int AdobeType0Font
Constants used to identify embedded font types- See Also:
- Constant Field Values
-
AdobeType1Font
static final int AdobeType1Font
- See Also:
- Constant Field Values
-
AdobeMultipleMasterFont
static final int AdobeMultipleMasterFont
- See Also:
- Constant Field Values
-
AdobeType3Font
static final int AdobeType3Font
- See Also:
- Constant Field Values
-
TrueTypeFont
static final int TrueTypeFont
- See Also:
- Constant Field Values
-
AdobeCIDType0Font
static final int AdobeCIDType0Font
- See Also:
- Constant Field Values
-
AdobeCIDType2Font
static final int AdobeCIDType2Font
- See Also:
- Constant Field Values
-
UnknownFontType
static final int UnknownFontType
- See Also:
- Constant Field Values
-
-
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).
-
-