public class PDFontTools extends Object
For more sophisticated help, see IFontOutlet.
| Constructor and Description |
|---|
PDFontTools() |
| Modifier and Type | Method and Description |
|---|---|
static PDFont |
createBuiltinFont(String name)
Create a well known Type1 font.
|
static PDFont |
getFont(PDDocument document,
PDResources resources,
COSName name)
The font
name, looked up in resources. |
static PDFont |
getFont(PDResources resources,
COSName name)
The font
name, looked up in resources. |
static List |
getFonts(PDDocument doc)
Determine the fonts contained as objects within the document.
|
static float |
getGlyphHeight(PDFont font)
The font height in user space coordinates.
|
static float |
getGlyphHeightScaled(PDFont font,
float size)
The scaled font height in user space coordinates.
|
static int |
getGlyphWidthEncoded(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. |
static float |
getGlyphWidthEncodedScaled(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. |
static PDFont |
getType0Font(PDFont font)
"Scale up"
font to a multibyte font. |
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.
|
public static PDFont createBuiltinFont(String name)
name - The font name.public static PDFont getFont(PDDocument document, PDResources resources, COSName name)
name, looked up in resources.
When no matching resource is found, a builtin font is created on the fly.
document - resources - name - name, looked up in resources.public static PDFont getFont(PDResources resources, COSName name)
name, looked up in resources.resources - name - name, looked up in resources.public static List getFonts(PDDocument doc)
doc - The PDDocument to parsePDFont objects in the document.public static float getGlyphHeight(PDFont font)
font - The font to be used.public static float getGlyphHeightScaled(PDFont font, float size)
font - The font to be used.size - The font sizepublic static int getGlyphWidthEncoded(PDFont font, byte[] codepoints, int offset, int length)
length
bytes from codepoints starting at offset.font - codepoints - offset - length - length bytes from codepoints starting
at offset.public static float getGlyphWidthEncodedScaled(PDFont font, float size, byte[] codepoints, int offset, int length)
length bytes from codepoints starting at
offset.font - size - codepoints - offset - length - length bytes from codepoints starting
at offset.public static PDFont getType0Font(PDFont font)
font to a multibyte font.font - public static List getUsedFonts(PDDocument doc, boolean considerTR)
doc - The PDDocument to parseconsiderTR - If true, considers font references with Text rendering mode 3
as unusedCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.