| Modifier and Type | Field and Description |
|---|---|
| private Float | |
| private final CFFType1Font | |
| private BoundingBox | |
| private Matrix | |
| private final AffineTransform | |
| private final FontBoxFont | |
| private final Map | |
| private final boolean | |
| private final boolean | |
| private static final Log |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| 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 BoundingBox | |
| private float | |
| public float | getAverageFontWidth()
Overrides org. Implements org. This will get the average font width for all characters. |
| public final String | |
| public BoundingBox | getBoundingBox()
Implements org. Returns the font's bounding box. |
| public CFFType1Font | |
| public FontBoxFont | getFontBoxFont()
Implements abstract org. Returns the embedded or system font used for rendering. |
| public final Matrix | getFontMatrix()
Overrides org. Implements org. Returns the font matrix, which represents the transformation from glyph space to text space. |
| public float | getHeight(int
character code code)Implements org. Returns the height of the given character, in glyph space. |
| public final String | getName()
Implements org. Returns the name of this font, either the PostScript "BaseName" or the Type 3 "Name". |
| private String | getNameInFont(String name)
Maps a PostScript glyph name to the name in the underlying font, for example when using a TTF font we might map "W" to "uni0057". |
| 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. |
| public GeneralPath | getPath(String
glyph name name)Implements abstract org. Returns the path for the character with the given name. |
| 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 float | getStringWidth(String
The text to get the width of. string)Overrides org. Returns the width of the given Unicode string. |
| public float | getWidthFromFont(int
character code code)Implements org. Returns the width of a glyph in the embedded font file. |
| 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 | hasGlyph(String
glyph name name)Implements abstract org. Returns true if the font contains the character with the given name. |
| 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 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. |
| avgWidth | back to summary |
|---|---|
| private Float avgWidth | |
| cffFont | back to summary |
|---|---|
| private final CFFType1Font cffFont | |
| fontBBox | back to summary |
|---|---|
| private BoundingBox fontBBox | |
| fontMatrix | back to summary |
|---|---|
| private Matrix fontMatrix | |
| fontMatrixTransform | back to summary |
|---|---|
| private final AffineTransform fontMatrixTransform | |
| genericFont | back to summary |
|---|---|
| private final FontBoxFont genericFont | |
| glyphHeights | back to summary |
|---|---|
| private final Map<String, Float> glyphHeights | |
| 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 | |
| PDType1CFont | back to summary |
|---|---|
| public PDType1CFont(COSDictionary fontDictionary) throws IOException Constructor.
| |
| codeToName | back to summary |
|---|---|
| public String codeToName(int 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.
| |
| generateBoundingBox | back to summary |
|---|---|
| private BoundingBox generateBoundingBox() throws IOException | |
| getAverageCharacterWidth | back to summary |
|---|---|
| private float getAverageCharacterWidth() | |
| getAverageFontWidth | back to summary |
|---|---|
| public float getAverageFontWidth() Overrides org. Implements org. Doc from org. This will get the average font width for all characters.
| |
| 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.
| |
| getCFFType1Font | back to summary |
|---|---|
| public CFFType1Font getCFFType1Font() Returns the embedded Type 1-equivalent CFF font.
| |
| 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.
| |
| getFontMatrix | back to summary |
|---|---|
| public final Matrix getFontMatrix() Overrides org. Implements org. Doc from org. Returns the font matrix, which represents the transformation from glyph space to text space. | |
| 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 final String getName() Implements org. Doc from org. Returns the name of this font, either the PostScript "BaseName" or the Type 3 "Name". | |
| getNameInFont | back to summary |
|---|---|
| private String getNameInFont(String name) throws IOException Maps a PostScript glyph name to the name in the underlying font, for example when using a TTF font we might map "W" to "uni0057". | |
| 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.
| |
| 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. *
| |
| 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.
| |
| getStringWidth | back to summary |
|---|---|
| public float getStringWidth(String string) throws IOException Overrides org. Doc from org. Returns the width of the given Unicode string.
| |
| 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(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.
| |
| 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.
| |
| 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.
| |
| 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.
| |