TrueTypeFont
Общ преглед
TrueTypeFont е клас в Aspose.PDF FOSS за Java. Наследници от: PdfFont.
TrueType шрифт (/подтип /TrueType) - ISO 32000-1:2008, 9.6.3.
Този клас предоставя 15 метода за работа с TrueTypeFont обекти в Java програми. Наличните методи включват: TrueTypeFont, decode, fromDictionary, getBaseFont, getEncoding, getFontDescriptor, getFontDictionary, getFontMetrics, getToUnicode, getTrueTypeReader, getWidth, glyphOutlineForCode, и 3 допълнителни методи. Всички публични членове са достъпни за всяко приложение на Java след инсталиране на пакета Aspose.PDF FOSS for Java. Свойства: baseFont, composite, encoding, fontDescriptor, fontDictionary, fontMetrics, и още 2 .
Свойства на веществата
| Име на фирмата: | Тип на изпитване | Достъп до информация | Описание на състоянието |
|---|---|---|---|
trueTypeReader | TrueTypeReader | Прочети. | Връща TrueTypeReader, ако програмата за шрифтове е била заредена. |
baseFont | String | Прочети. | Връща името на основния шрифт (/BaseFont). |
encoding | FontEncoding | Прочети. | Връща кодирането на шрифта. |
toUnicode | ToUnicodeCMap | Прочети. | Връща CMap. |
fontDescriptor | FontDescriptor | Прочети. | Връща описателя на шрифта. |
composite | boolean | Прочети. | Връща {@code true}, когато това е тип 0 композитен шрифт, чийто |
| Кодирането на потока от съдържание използва многобайтови символни кодове (напр. | |||
fontMetrics | FontMetrics | Прочети. | Връща метриката на шрифта. |
fontDictionary | PdfDictionary | Прочети. | Връща основния словар на шрифта. |
Методи за изчисляване на данните
| Подписът | Описание на състоянието |
|---|---|
TrueTypeFont(fontDict: PdfDictionary, parser: PDFParser) | Създава TrueTypeFont от речник за шрифтове. |
decode(charCodes: byte[]) → String | |
getWidth(charCode: int) → double | |
getTrueTypeReader() → TrueTypeReader | Връща TrueTypeReader, ако програмата за шрифтове е била заредена. |
resolveGlyphId(code: int) → int | Картиране на код за символи към идентификатор на глифа в вградената програма, след като се използва: |
| TrueType Правилата за подбор на знаци по ISO 32000-1:2008 §9.6.6.4: |
- symbolic font with no explicit /Encoding → embedde |
| `glyphOutlineForCode(code: int)` → `java.awt.geom.GeneralPath` | Returns the em-normalised, Y-up outline of the glyph selected by
{@link #resolveGlyphId(int)} for the given character code, or {@code null}
when no embedded program is present or the glyph cannot be resolved. |
| `hasExplicitEncoding()` → `boolean` | Returns true if the font dictionary carries an explicit /Encoding
(a base-encoding name or an encoding dictionary). |
| `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. |
Вижте също: