Branch: refs/heads/fix-setUnicodeRanges-bits-123-127
Home:
https://github.com/fonttools/fonttools
Commit: 7d0902b2e27ec1433b015b3b8a79391d7c8604cb
https://github.com/fonttools/fonttools/commit/7d0902b2e27ec1433b015b3b8a79391d7c8604cb
Author: Cosimo Lupo <
cos...@anthrotype.com>
Date: 2026-05-13 (Wed, 13 May 2026)
Changed paths:
M Lib/fontTools/ttLib/tables/O_S_2f_2.py
M Tests/ttLib/tables/O_S_2f_2_test.py
Log Message:
-----------
OS/2: fix setUnicodeRanges round-trip for reserved bits 123-127
Bits 123-127 are reserved in the OpenType spec and not assigned to any
Unicode block, so the cap at 123 in setUnicodeRanges was intentional.
However, getUnicodeRanges reads all 128 raw bits, so a font with those
reserved bits already set (by another tool) will have them returned by
getUnicodeRanges but rejected by setUnicodeRanges -- causing a crash in
recalcUnicodeRanges(pruneOnly=True), which preserves bits it cannot
evaluate rather than clearing them.
Accept bits 0-127 to allow the round-trip, without assigning any
meaning to the reserved range.
Fixes #4087
To unsubscribe from these emails, change your notification settings at
https://github.com/fonttools/fonttools/settings/notifications