Package com.ribs.pdf
Interface FontFactory
- All Known Implementing Classes:
PDFFontFactory
public interface FontFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Constants used to identify embedded font typesstatic final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionWhen all else fails, use this font.Look on the system for a font with the given name.Given a Font dictionary with keys and values as described in the pdf spec, return a java.awt.Font to use for it.getGlyphMapper
(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.getGlyphWidths
(Map fontDict, PDFFile srcfile) Returns the array of widths for all glyphs in the font.getSubstituteFont
(Map fontDict) Try some font substitutions.
-
Field Details
-
AdobeType0Font
static final int AdobeType0FontConstants used to identify embedded font types- See Also:
-
AdobeType1Font
static final int AdobeType1Font- See Also:
-
AdobeMultipleMasterFont
static final int AdobeMultipleMasterFont- See Also:
-
AdobeType3Font
static final int AdobeType3Font- See Also:
-
TrueTypeFont
static final int TrueTypeFont- See Also:
-
AdobeCIDType0Font
static final int AdobeCIDType0Font- See Also:
-
AdobeCIDType2Font
static final int AdobeCIDType2Font- See Also:
-
UnknownFontType
static final int UnknownFontType- See Also:
-
-
Method Details
-
getFont
Given a Font dictionary with keys and values as described in the pdf spec, return a java.awt.Font to use for it. -
getFont
Look on the system for a font with the given name. -
getSubstituteFont
Try some font substitutions. -
getDefaultFont
Font getDefaultFont()When all else fails, use this font. Damn well better return something. -
getGlyphMapper
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
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).
-