| java.lang.Object de.intarsys.pdf.font.PDFontTools
PDFontTools | public class PDFontTools (Code) | | Tool class for handling PDF fonts.
For more sophisticated help, see
IFontOutlet .
|
Method Summary | |
protected static void | collectFonts(Set fonts, CSContent content, PDResources resources, boolean considerTR) | protected static PDFont | createLazyFont(PDDocument document, COSName name) A builtin font created "on the fly"
A font was requested in a content stream that can't be looked up in the
associated resources. | public static PDFont | getFont(PDDocument document, PDResources resources, COSName name) The font name , looked up in resources . | public static PDFont | getFont(PDResources resources, COSName name) The font name , looked up in resources . | public static List | getFonts(PDDocument doc) Determine the fonts contained as objects within the document. | public static float | getGlyphHeight(PDFont font) The font height in user space coordinates. | public static float | getGlyphHeightScaled(PDFont font, float size) The scaled font height in user space coordinates. | public static int | getGlyphWidth(PDFont font, byte[] codepoints, int offset, int length) The sum of the length of all glyphs referenced by length
bytes from codepoints starting at offset . | public static float | getGlyphWidthScaled(PDFont font, float size, byte[] codepoints, int offset, int length) The scaled sum of the length of all glyphs referenced by
length bytes from codepoints starting at
offset . | public static float | getGlyphWidthScaled(PDFont font, float size, int codepoint) The scaled width of the glyphs referenced by codepoint . | public static List | getUsedFonts(PDDocument doc, boolean considerTR) Tries to determine which fonts are really used within the document
The following criteria are used to determine usage of a font. |
createLazyFont | protected static PDFont createLazyFont(PDDocument document, COSName name)(Code) | | A builtin font created "on the fly"
A font was requested in a content stream that can't be looked up in the
associated resources. Some PDF engines just omit the font object when
dealing with builtins - try to interpret as such.
Parameters: document - The document requesting the font. Parameters: name - The fonts name A builtin font created "on the fly" |
getFont | public static PDFont getFont(PDDocument document, PDResources resources, COSName name)(Code) | | The font name , looked up in resources .
When no matching resource is found, a builtin font is created on the fly.
Parameters: document - Parameters: resources - Parameters: name - The font name , looked up inresources . |
getFont | public static PDFont getFont(PDResources resources, COSName name)(Code) | | The font name , looked up in resources .
Parameters: resources - Parameters: name - The font name , looked up inresources . |
getFonts | public static List getFonts(PDDocument doc)(Code) | | Determine the fonts contained as objects within the document.
Parameters: doc - The PDDocument to parse Collection of all PDFont objects in the document. |
getGlyphHeight | public static float getGlyphHeight(PDFont font)(Code) | | The font height in user space coordinates.
Parameters: font - The font to be used. Parameters: size - The font size The scaled font height in user space coordinates. |
getGlyphHeightScaled | public static float getGlyphHeightScaled(PDFont font, float size)(Code) | | The scaled font height in user space coordinates.
Parameters: font - The font to be used. Parameters: size - The font size The scaled font height in user space coordinates. |
getGlyphWidth | public static int getGlyphWidth(PDFont font, byte[] codepoints, int offset, int length)(Code) | | The sum of the length of all glyphs referenced by length
bytes from codepoints starting at offset .
Parameters: font - Parameters: codepoints - Parameters: offset - Parameters: length - The sum of the length of all glyphs referenced bylength bytes from codepoints starting at offset . |
getGlyphWidthScaled | public static float getGlyphWidthScaled(PDFont font, float size, byte[] codepoints, int offset, int length)(Code) | | The scaled sum of the length of all glyphs referenced by
length bytes from codepoints starting at
offset .
Parameters: font - Parameters: size - Parameters: codepoints - Parameters: offset - Parameters: length - The scaled sum of the length of all glyphs referenced bylength bytes from codepoints starting at offset . |
getGlyphWidthScaled | public static float getGlyphWidthScaled(PDFont font, float size, int codepoint)(Code) | | The scaled width of the glyphs referenced by codepoint .
Parameters: font - Parameters: size - Parameters: codepoint - The scaled sum of the length of all glyphs referenced bylength bytes from codepoints starting at offset . |
getUsedFonts | public static List getUsedFonts(PDDocument doc, boolean considerTR)(Code) | | Tries to determine which fonts are really used within the document
The following criteria are used to determine usage of a font.
Any glyph of the font is referenced in
- the Contents stream of a page object
- the stream of a Form XObject
- the appearance stream of an annotation, including form fields
- the content stream of a Type 3 font glyph
- the stream of a tiling pattern
Parameters: doc - The PDDocument to parse Parameters: considerTR - If true, considers font references with Text rendering mode 3as unused Set of all used fonts |
|
|