Files
harfbuzz/test/api/fonts/cff1_encoding0_bounded.otf
Behdad Esfahbod eb9dc91893 [subset] Bound CFF1 encoding lookups by the glyph count (#6543)
An explicit glyph map can create empty output glyphs beyond the source
font's glyph count. When preserving codes for gaps in the mapping, the
subsetter queries those nonexistent source glyphs. Excess entries in a
malformed custom encoding can then give the new empty glyphs codes.

Return CFF_UNDEF_CODE for glyphs outside the source font before reading
the encoding. Add format 0 and format 1 regression cases comparing
ordinary and explicitly remapped subsets against bounded encodings,
with a generator for the small synthetic fonts.

Both new cases fail before the fix. All 275 tests pass with
meson test -C build --print-errorlogs --num-processes 12.

Related: https://github.com/googlefonts/fontations/pull/2398
Assisted-by: Codex
2026-11-01 14:14:09 -07:00

664 B