CIDFont
Overview
CIDFont is a class in Aspose.PDF FOSS for Java.
Inherits from: PdfFont.
CID font (ISO 32000-1:2008, §9.7.4).
This class provides 16 methods for working with CIDFont objects in Java programs.
Available methods include: CIDFont, cidToUnicode, decode, fromDictionary, getBaseFont, getDefaultWidth, getEncoding, getFontDescriptor, getFontDictionary, getFontMetrics, getToUnicode, getWidth, and 4 additional methods.
All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package.
Properties: baseFont, composite, defaultWidth, encoding, fontDescriptor, fontDictionary, and 3 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
type2 | boolean | Read | Returns true if the descendant subtype is CIDFontType2 (TrueType-housed, |
| glyph ids resolvable via /CIDToGIDMap). | |||
defaultWidth | double | Read | Returns the default width (/DW). |
baseFont | String | Read | Returns the base font name (/BaseFont). |
encoding | FontEncoding | Read | Returns the font encoding. |
toUnicode | ToUnicodeCMap | Read | Returns the ToUnicode CMap. |
fontDescriptor | FontDescriptor | Read | Returns the font descriptor. |
composite | boolean | Read | Returns {@code true} when this is a Type0 composite font whose |
| content-stream encoding uses multi-byte character codes (e.g. | |||
fontMetrics | FontMetrics | Read | Returns the font metrics. |
fontDictionary | PdfDictionary | Read | Returns the underlying font dictionary. |
Methods
| Signature | Description |
|---|---|
CIDFont(fontDict: PdfDictionary, parser: PDFParser) | Creates a CIDFont from a font dictionary. |
cidToUnicode(cid: int) → int | Recovers the Unicode code point for a CID using the embedded font program, |
| for the common case of a CIDFontType2 (TrueType) descendant that ships | |
| neither a {@code /ToUnicode} CMap on its parent Type0 font. | |
toGlyphId(cid: int) → int | Maps a CID to the embedded font program’s glyph id via /CIDToGIDMap |
| (explicit stream or the default Identity). | |
glyphOutline(gid: int) → java.awt.geom.GeneralPath | Returns the em-normalised, Y-up outline of the given glyph id from the |
| embedded TrueType program, or {@code null} when no embedded program is | |
| available or the glyph cannot be parsed. | |
isType2() → boolean | Returns true if the descendant subtype is CIDFontType2 (TrueType-housed, |
| glyph ids resolvable via /CIDToGIDMap). | |
getWidth(cid: int) → double | |
getDefaultWidth() → double | Returns the default width (/DW). |
decode(charCodes: byte[]) → String | Decodes raw character code bytes to a Unicode string. |
getBaseFont() → String | Returns the base font name (/BaseFont). |
getEncoding() → FontEncoding | Returns the font encoding. |
getToUnicode() → ToUnicodeCMap | Returns the ToUnicode CMap. |
getFontDescriptor() → FontDescriptor | Returns the font descriptor. |
isComposite() → boolean | Returns {@code true} when this is a Type0 composite font whose |
| content-stream encoding uses multi-byte character codes (e.g. | |
getFontMetrics() → FontMetrics | Returns the font metrics. |
getFontDictionary() → PdfDictionary | Returns the underlying font dictionary. |
fromDictionary(fontDict: PdfDictionary, parser: PDFParser) → PdfFont | Creates the appropriate PdfFont subclass from a font dictionary. |