Files
harfbuzz/test/api/fonts/cff1_encoding_many_codes.otf
Beleniuc Ilie 4868fd314f [subset] Use CFF1 Encoding format 1 for more than 255 codes (#6460)
A format 1 Encoding can give codes to more than 255 glyphs, since
codes may repeat across ranges. When the subset keeps more than 255
of those glyphs, as with retain-gids, plan_subset_encoding() hit
assert (subset_enc_num_codes <= 0xFF).

Choose format 0 only when it can hold the codes, and fail cleanly in
the format 1 serializer instead of truncating nRanges past 255.

Add a test font whose format 1 Encoding covers 768 glyphs, and the
reporter's font to the fuzzing corpus.

Fixes: https://github.com/harfbuzz/harfbuzz/issues/6031
Assisted-by: Claude
Assisted-by: OpenAI Codex
2026-10-29 16:35:22 -06:00

10 KiB