Module charmap

Source
Expand description

Mapping of characters (codepoints, not graphemes) to nominal glyph identifiers.

If you have never run into character to glyph mapping before Glyph IDs and the ‘cmap’ table might be informative.

The functionality in this module provides a 1-to-1 mapping from Unicode characters (or Unicode variation sequences) to nominal or “default” internal glyph identifiers for a given font. This is a necessary first step, but generally insufficient for proper layout of complex text or even simple text containing diacritics and ligatures.

Comprehensive mapping of characters to positioned glyphs requires a process called shaping. For more detail, see: Why do I need a shaping engine?

Structs§

Charmap
Mapping of characters to nominal glyph identifiers.
CodepointSubtable 🔒
MappingIndex
Cacheable indices of selected mapping tables for materializing a character map.
MappingSelection 🔒
The result of searching the cmap table for the “best” available subtables.
Mappings
Iterator over all mappings of character to nominal glyph identifier in a character map.
VariantMappings
Iterator over all mappings of character and variation selector to nominal glyph identifier in a character map.

Enums§

MapVariant
Result of mapping a codepoint with a variation selector.
MappingKind 🔒
The mapping kind of a cmap subtable.
MappingsInner 🔒
SupportedSubtable 🔒

Functions§

get_subtable 🔒