Font files
cmap format 4 glyph lookup
Resolve BMP code points through a font’s format-4 cmap subtable.
Your inputs
Start with an exampleYour result
Example resultAa — A small example of your colors.
How it works
Find the segment covering each code point. Apply idDelta modulo 65536; for a nonzero idRangeOffset, read the relative glyph-array entry and preserve a zero missing-glyph value.
The sample maps U+0041 and U+0042 to glyphs 1 and 2. U+0043 and the sentinel map to missing glyph 0.
Limits
One complete format-4 subtable, not a whole font. Up to 8192 nonoverlapping segments and 10000 queries. No shaping, font rendering, supplementary-plane lookup or glyph-count validation. Structural offsets are checked; full OpenType conformance is not.