TtfCMap

class TtfCMap

TrueType / OpenType cmap table — character-code → glyph-index lookup.

The cmap table has multiple subtables for different encodings; we pick the best one (Unicode Microsoft Unicode everything else) and route lookups through it. Format 4 (segment-mapping-to-delta) is the workhorse for BMP Unicode; format 12 (segmented coverage) handles supplementary planes; formats 0 and 6 are legacy but still appear in older fonts.

Glyph index 0 is the special .notdef glyph — we return it for any unmapped codepoint so callers always get something drawable.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun glyphIdFor(codePoint: Int): Int