[fonttools/fonttools] c9d032: Round-trip empty Macintosh cmap format 2 subtables

1 view
Skip to first unread message

Cosimo Lupo

unread,
Aug 20, 2026, 8:52:12 AM (6 days ago) Aug 20
to fontto...@googlegroups.com
Branch: refs/heads/main
Home: https://github.com/fonttools/fonttools
Commit: c9d032f1725131853d39a3f332ad6d13da3ee555
https://github.com/fonttools/fonttools/commit/c9d032f1725131853d39a3f332ad6d13da3ee555
Author: Vincent Gao <gaobi...@gmail.com>
Date: 2026-06-30 (Tue, 30 Jun 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/_c_m_a_p.py
M Tests/ttLib/tables/_c_m_a_p_test.py

Log Message:
-----------
Round-trip empty Macintosh cmap format 2 subtables

A format 2 (Mac high-byte) cmap that maps its whole range to .notdef
decompiles to an empty cmap ({}), but recompiling it crashed with
IndexError: cmap_format_2.compile indexed charCodes[0] to decide whether to
force-create subHeader 0, and setIDDelta indexed glyphIndexArray[0], both of
which are empty for an all-notdef cmap. Force subHeader 0 when there are no
char codes at all, and leave idDelta at 0 for an empty subheader. Mirrors
the existing empty-format-4 support.

Fixes #3663.


Commit: 0312befe139e4e4fa42355f28791f83e998eba73
https://github.com/fonttools/fonttools/commit/0312befe139e4e4fa42355f28791f83e998eba73
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-08-20 (Thu, 20 Aug 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/_c_m_a_p.py
M Tests/ttLib/tables/_c_m_a_p_test.py

Log Message:
-----------
Merge pull request #4117 from gaoflow/cmap-format2-empty-roundtrip

Round-trip empty Macintosh cmap format 2 subtables (#3663)


Compare: https://github.com/fonttools/fonttools/compare/23e86b6573b7...0312befe139e

To unsubscribe from these emails, change your notification settings at https://github.com/fonttools/fonttools/settings/notifications
Reply all
Reply to author
Forward
0 new messages