The dense DefaultUVS copy path merged adjacent source ranges without
respecting additionalCount's 8-bit limit. Subsetting 257 consecutive
default UVS mappings could leave only one mapping after count truncation.
Start a new range before the additional count overflows. Exercise cmap
formats 14 and 15 at 1, 255, 256, 257, 512, 513, and 768 mappings, checking
both the retained mapping count and the last variation glyph.
Built with C++11 and ran the complete Meson suite: 279 passed.
Assisted-by: OpenAI Codex
Consult DMAP before cmap for nominal and variation mappings, and combine
their character coverage while retaining DMAP precedence. Reuse the cmap
parser and serializer for DMAP, including effective subsetting closure.
Keep DMAP available independently of beyond-64K support; only cmap format
15 remains conditional.
Tested with the full Meson suite and with an HB_NO_BEYOND_64K build.
Assisted-by: OpenAI Codex <codex@openai.com>
Template the variation-selector structures by glyph-ID width.
Add format 15 lookup, collection, sanitization, and closure.
Add format 15 subsetting.
Prefer format 15 when both variation-selector formats are present.
Assisted-by: OpenAI Codex
cmap14 subsetting code was not considering variation selectors in the input unicode set when deciding which variant glyphs to keep. This updates subsetting to only keeps variant glyphs if their variation selector code point is in the input unicodes set.
For https://github.com/harfbuzz/harfbuzz/issues/4911
NotoColorEmoji.ttf uses two cmap subtables
Format 14 | Platform ID 0 | Platform Encoding ID 5
Format 12 | Platform ID 3 | Platform Encoding ID 10
This combination results in the cmap table being dropped during subsetting despite being valid/required.
Include stdbool.h in hb-setset-test.h instead of in the individual
sources, if it is found; otherwise use a simplistic fallback for it if
it is not found.
Also declare variables at the top of the block, to build on pre-C99
compiliers.