Documentation ¶
Overview ¶
Package cmap reads and writes "cmap" tables. https://docs.microsoft.com/en-us/typography/opentype/spec/cmap
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format12 ¶ added in v0.3.4
Format12 represents a format 12 cmap subtable. https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#format-12-segmented-coverage
The binary encoding is most efficient, if consecutive code points are mapped to consecutive glyph IDs.
type Format4 ¶
Format4 represents a format 4 cmap subtable. https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#format-4-segment-mapping-to-delta-values
type Key ¶
type Key struct { PlatformID uint16 // Platform ID. EncodingID uint16 // Platform-specific encoding ID. Language uint16 }
Key selects a subtable of a cmap table.
type Subtable ¶
type Subtable interface { // Lookup returns the glyph index for the given rune. // If the rune is not found, Lookup returns 0 (corresponding to the ".notdef" glyph). Lookup(r rune) glyph.ID // Encode returns the binary form of the subtable. Encode(language uint16) []byte // CodeRange returns the smallest and largest code point in the subtable. CodeRange() (low, high rune) }
Subtable represents a decoded cmap subtable.
type Table ¶
Table contains all subtables from a cmap table.
func Decode ¶
Decode returns all subtables of the given "cmap" table. The returned subtables are guaranteed to be at least 10 bytes long and to have a valid format value (0, 2, 4, 6, 8, 10, 12, 13 or 14) in the first two bytes.