| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private CmapSubtable | |
| private CmapSubtable | |
| private CmapSubtable | |
| private BoundingBox | |
| private Map | |
| private static final Map | |
| private final boolean | |
| private final boolean | |
| private static final Log | |
| private final OpenTypeFont | |
| private static final int | |
| private static final int | |
| private static final int | |
| private final TrueTypeFont |
| Access | Constructor and Description |
|---|---|
| public | PDTrueTypeFont(COSDictionary
The font dictionary according to the PDF specification. fontDictionary)Creates a new TrueType font from a Font dictionary. |
| private | PDTrueTypeFont(PDDocument document, TrueTypeFont ttf, Encoding encoding, boolean closeTTF)
Creates a new TrueType font for embedding. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: GID (glyph index)character code code)Returns the GID for the given character code. |
| protected byte[] | encode(int
Unicode code point. unicode)Implements abstract org. Encodes the given Unicode code point for use in a PDF content stream. |
| private void | |
| private BoundingBox | |
| public final String | |
| public BoundingBox | getBoundingBox()
Implements org. Returns the font's bounding box. |
| public FontBoxFont | getFontBoxFont()
Implements abstract org. Returns the embedded or system font used for rendering. |
| protected Map | |
| public float | getHeight(int
character code code)Implements org. Returns the height of the given character, in glyph space. |
| public String | getName()
Implements org. Returns the name of this font, either the PostScript "BaseName" or the Type 3 "Name". |
| public GeneralPath | getNormalizedPath(int
character code in a PDF. Not to be confused with unicode. code)Implements org. Returns the normalized glyph path for the given character code in a PDF. |
| private TTFParser | |
| public GeneralPath | getPath(int
character code in a PDF. Not to be confused with unicode. code)Implements org. Returns the glyph path for the given character code. |
| public GeneralPath | getPath(String
glyph name name)Implements abstract org. Returns the path for the character with the given name. |
| private GeneralPath | |
| public TrueTypeFont | Returns: the embedded or substituted TrueType fontReturns the embedded or substituted TrueType font. |
| public float | getWidthFromFont(int
character code code)Implements org. Returns the width of a glyph in the embedded font file. |
| public boolean | hasGlyph(String
glyph name name)Implements abstract org. Returns true if the font contains the character with the given name. |
| public boolean | hasGlyph(int
character code in a PDF. Not to be confused with unicode. code)Implements org. Returns true if this font contains a glyph for the given character code in a PDF. |
| public boolean | isDamaged()
Implements org. Returns true if the embedded font file is damaged. |
| public boolean | isEmbedded()
Implements org. Returns true if the font file is embedded in the PDF. |
| public static PDTrueTypeFont | Returns: a PDTrueTypeFont instance.The PDF document that will hold the embedded font. doc, File A TTF file. file, Encoding The PostScript encoding vector to be used for embedding. encoding)Loads a TTF to be embedded into a document as a simple font. |
| public static PDTrueTypeFont | Returns: a PDTrueTypeFont instance.The PDF document that will hold the embedded font. doc, InputStream A TTF file stream input, Encoding The PostScript encoding vector to be used for embedding. encoding)Loads a TTF to be embedded into a document as a simple font. |
| public static PDTrueTypeFont | Returns: a PDTrueTypeFont instance.The PDF document that will hold the embedded font. doc, TrueTypeFont A true type font ttf, Encoding The PostScript encoding vector to be used for embedding. encoding)Loads a TTF to be embedded into a document as a simple font. |
| public static PDTrueTypeFont | Returns: a PDTrueTypeFont instance.The PDF document that will hold the embedded font. doc, RandomAccessRead the source of the TTF. randomAccessRead, Encoding The PostScript encoding vector to be used for embedding. encoding)Loads a TTF to be embedded into a document as a simple font. |
| public int | readCode(InputStream
string stream in)Implements abstract org. Reads a character code from a content stream string. |
| protected Encoding | readEncodingFromFont()
Implements abstract org. Called by readEncoding() if the encoding needs to be extracted from the font file. |
| cmapInitialized | back to summary |
|---|---|
| private boolean cmapInitialized | |
| cmapMacRoman | back to summary |
|---|---|
| private CmapSubtable cmapMacRoman | |
| cmapWinSymbol | back to summary |
|---|---|
| private CmapSubtable cmapWinSymbol | |
| cmapWinUnicode | back to summary |
|---|---|
| private CmapSubtable cmapWinUnicode | |
| fontBBox | back to summary |
|---|---|
| private BoundingBox fontBBox | |
| gidToCode | back to summary |
|---|---|
| private Map<Integer, Integer> gidToCode | |
| INVERTED_MACOS_ROMAN | back to summary |
|---|---|
| private static final Map<String, Integer> INVERTED_MACOS_ROMAN | |
| isDamaged | back to summary |
|---|---|
| private final boolean isDamaged | |
| isEmbedded | back to summary |
|---|---|
| private final boolean isEmbedded | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| otf | back to summary |
|---|---|
| private final OpenTypeFont otf | |
| START_RANGE_F000 | back to summary |
|---|---|
| private static final int START_RANGE_F000 | |
| START_RANGE_F100 | back to summary |
|---|---|
| private static final int START_RANGE_F100 | |
| START_RANGE_F200 | back to summary |
|---|---|
| private static final int START_RANGE_F200 | |
| ttf | back to summary |
|---|---|
| private final TrueTypeFont ttf | |
| PDTrueTypeFont | back to summary |
|---|---|
| public PDTrueTypeFont(COSDictionary fontDictionary) throws IOException Creates a new TrueType font from a Font dictionary.
| |
| PDTrueTypeFont | back to summary |
|---|---|
| private PDTrueTypeFont(PDDocument document, TrueTypeFont ttf, Encoding encoding, boolean closeTTF) throws IOException Creates a new TrueType font for embedding. | |
| codeToGID | back to summary |
|---|---|
| public int codeToGID(int code) throws IOException Returns the GID for the given character code.
| |
| encode | back to summary |
|---|---|
| protected byte[] encode(int unicode) throws IOException Implements abstract org. Doc from org. Encodes the given Unicode code point for use in a PDF content stream. Content streams use a multi-byte encoding with 1 to 4 bytes. This method is called when embedding text in PDFs and when filling in fields.
| |
| extractCmapTable | back to summary |
|---|---|
| private void extractCmapTable() throws IOException extract all useful "cmap" subtables. | |
| generateBoundingBox | back to summary |
|---|---|
| private BoundingBox generateBoundingBox() throws IOException | |
| getBaseFont | back to summary |
|---|---|
| public final String getBaseFont() Returns the PostScript name of the font.
| |
| getBoundingBox | back to summary |
|---|---|
| public BoundingBox getBoundingBox() throws IOException Implements org. Doc from org. Returns the font's bounding box.
| |
| getFontBoxFont | back to summary |
|---|---|
| public FontBoxFont getFontBoxFont() Implements abstract org. Doc from org. Returns the embedded or system font used for rendering. This is never null.
| |
| getGIDToCode | back to summary |
|---|---|
| protected Map Inverts the font's code -> GID mapping. Any duplicate (GID -> code) mappings will be lost.
| |
| getHeight | back to summary |
|---|---|
| public float getHeight(int code) throws IOException Implements org. Doc from org. Returns the height of the given character, in glyph space. This can be expensive to calculate. Results are only approximate. Warning This method is deprecated in PDFBox 2.0 because there is no meaningful value which it can return. The
| |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. Returns the name of this font, either the PostScript "BaseName" or the Type 3 "Name". | |
| getNormalizedPath | back to summary |
|---|---|
| public GeneralPath getNormalizedPath(int code) throws IOException Implements org. Doc from org. Returns the normalized glyph path for the given character code in a PDF. The resulting path is normalized to the PostScript 1000 unit square, and fallback glyphs are returned where appropriate, e.g. for missing glyphs.
| |
| getParser | back to summary |
|---|---|
| private TTFParser getParser(RandomAccessRead randomAccessRead, boolean isEmbedded) throws IOException | |
| getPath | back to summary |
|---|---|
| public GeneralPath getPath(int code) throws IOException Implements org. Doc from org. Returns the glyph path for the given character code.
| |
| getPath | back to summary |
|---|---|
| public GeneralPath getPath(String name) throws IOException Implements abstract org. Doc from org. Returns the path for the character with the given name. For some fonts, GIDs may be used instead of names when calling this method. *
| |
| getPathFromOutlines | back to summary |
|---|---|
| private GeneralPath getPathFromOutlines(int code) throws IOException | |
| getTrueTypeFont | back to summary |
|---|---|
| public TrueTypeFont getTrueTypeFont() Returns the embedded or substituted TrueType font.
| |
| getWidthFromFont | back to summary |
|---|---|
| public float getWidthFromFont(int code) throws IOException Implements org. Doc from org. Returns the width of a glyph in the embedded font file.
| |
| hasGlyph | back to summary |
|---|---|
| public boolean hasGlyph(String name) throws IOException Implements abstract org. Doc from org. Returns true if the font contains the character with the given name.
| |
| hasGlyph | back to summary |
|---|---|
| public boolean hasGlyph(int code) throws IOException Implements org. Doc from org. Returns true if this font contains a glyph for the given character code in a PDF.
| |
| isDamaged | back to summary |
|---|---|
| public boolean isDamaged() Implements org. Doc from org. Returns true if the embedded font file is damaged.
| |
| isEmbedded | back to summary |
|---|---|
| public boolean isEmbedded() Implements org. Doc from org. Returns true if the font file is embedded in the PDF.
| |
| load | back to summary |
|---|---|
| public static PDTrueTypeFont load(PDDocument doc, File file, Encoding encoding) throws IOException Loads a TTF to be embedded into a document as a simple font. Note Simple fonts only support 256 characters. For Unicode support, use
| |
| load | back to summary |
|---|---|
| public static PDTrueTypeFont load(PDDocument doc, InputStream input, Encoding encoding) throws IOException Loads a TTF to be embedded into a document as a simple font. Note Simple fonts only support 256 characters. For Unicode support, use
| |
| load | back to summary |
|---|---|
| public static PDTrueTypeFont load(PDDocument doc, TrueTypeFont ttf, Encoding encoding) throws IOException Loads a TTF to be embedded into a document as a simple font. Note Simple fonts only support 256 characters. For Unicode support, use
| |
| load | back to summary |
|---|---|
| public static PDTrueTypeFont load(PDDocument doc, RandomAccessRead randomAccessRead, Encoding encoding) throws IOException Loads a TTF to be embedded into a document as a simple font. Note Simple fonts only support 256 characters. For Unicode support, use
| |
| readCode | back to summary |
|---|---|
| public int readCode(InputStream in) throws IOException Implements abstract org. Doc from org. Reads a character code from a content stream string. Codes may be up to 4 bytes long.
| |
| readEncodingFromFont | back to summary |
|---|---|
| protected Encoding readEncodingFromFont() throws IOException Implements abstract org. Doc from org. Called by readEncoding() if the encoding needs to be extracted from the font file.
| |