Class TtfCMapTable
Parsed OpenType "cmap" table (character-to-glyph-index mapping). Reads all encoding records from the table directory and parses the unique subtables; exposes FindUnicodeTable() to select the best subtable for Unicode text shaping. Ref: OpenType spec §5.6.
Inherited Members
Namespace: DRIT.Drawing.Font.Ttf.Tables
Assembly: DRIT.Drawing.dll
Syntax
public sealed class TtfCMapTable : TtfTableBase
Fields
TableTag
The table tag for the cmap table.
Declaration
public const string TableTag = "cmap"
Field Value
| Type | Description |
|---|---|
| string |
Properties
Subtables
All parsed CMap subtables.
Declaration
public IReadOnlyList<TtfCMapFormatBaseTable> Subtables { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<TtfCMapFormatBaseTable> |
Methods
FindUnicodeTable()
Finds the best Unicode-capable subtable. Priority order:
- Format 12, platform 0 or 3 (full Unicode coverage)
- Format 12, any platform
- Format 4, platform 3 (Windows BMP)
- Format 4, platform 0 (Unicode BMP)
- Format 4, any platform
Returns null if no usable Unicode subtable is found.
Declaration
public TtfCMapFormatBaseTable? FindUnicodeTable()
Returns
| Type | Description |
|---|---|
| TtfCMapFormatBaseTable |
Parse(byte[])
Parses the "cmap" table from its raw bytes.
Declaration
public static TtfCMapTable Parse(byte[] rawBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | rawBytes |
Returns
| Type | Description |
|---|---|
| TtfCMapTable |