Generic base class for all cmap subtables.
cmap format 8.0 is currently not implemented because use of the format is discouraged in the specification and no font with a format 8.0 cmap subtable was available for testing.
The preferred cmap format is 12.0 because it supports all of Unicode and allows for fast and memory efficient code-to-gid as well as gid-to-code mappings.
The complete code map.
The platform-specific encoding identifier.
The cmap format or
nil if the subtable wasn't read from a
The complete gid map.
The language code.
The platform identifier.
Public Class Methods
Creates a new subtable.
Public Instance Methods
Returns the glyph index for the given character code or
the character code is not mapped.
Returns a character code for the given glyph index or
the given glyph index does not exist or is not mapped to a character code.
Note that some fonts map multiple character codes to the same glyph (e.g. hyphen and minus), i.e. the code-to-glyph mapping is surjective but not injective! In such a case one of the available character codes is returned.
Parses the cmap subtable from the IO at the given offset.
If the subtable format is supported, the information is used to populate
this object and
true is returned. Otherwise nothing is done
false is returned.
true if this subtable contains a Unicode cmap.