[fonttools/fonttools] a06246: [cmap] Fix CmapSubtable.__lt__ TypeError on Python 3

0 views
Skip to first unread message

Cosimo Lupo

unread,
Mar 5, 2026, 12:39:43 PM (6 days ago) Mar 5
to fontto...@googlegroups.com
Branch: refs/heads/fix-cmap-subtable-sorting
Home: https://github.com/fonttools/fonttools
Commit: a06246b186cf851e6906171c21b20fc90c02d1db
https://github.com/fonttools/fonttools/commit/a06246b186cf851e6906171c21b20fc90c02d1db
Author: Cosimo Lupo <cl...@google.com>
Date: 2026-03-05 (Thu, 05 Mar 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:
-----------
[cmap] Fix CmapSubtable.__lt__ TypeError on Python 3

Remove __dict__ from comparison tuples in CmapSubtable.__lt__().
In Python 3, dict < dict raises TypeError, which caused sorting to
fail whenever two subtables shared the same (platformID, platEncID,
language) combination.

Fixes https://github.com/fonttools/fonttools/issues/4035


Commit: 10dc3d316e9bf116057d31eabc6034c884a5eb69
https://github.com/fonttools/fonttools/commit/10dc3d316e9bf116057d31eabc6034c884a5eb69
Author: Cosimo Lupo <cl...@google.com>
Date: 2026-03-05 (Thu, 05 Mar 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:
-----------
[cmap] Raise error on duplicate (platformID, platEncID, language) at compile time

The OpenType spec requires each (platformID, platEncID, language)
combination to appear only once in the cmap table. Validate this
during compile and raise a clear ValueError listing the duplicates.


Compare: https://github.com/fonttools/fonttools/compare/a49858ff4614...10dc3d316e9b

To unsubscribe from these emails, change your notification settings at https://github.com/fonttools/fonttools/settings/notifications

Cosimo Lupo

unread,
Mar 5, 2026, 1:21:25 PM (6 days ago) Mar 5
to fontto...@googlegroups.com
Branch: refs/heads/main
Commit: 614863e321ad113d79bbc1e997dcad7964183d83
https://github.com/fonttools/fonttools/commit/614863e321ad113d79bbc1e997dcad7964183d83
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-03-05 (Thu, 05 Mar 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 #4055 from fonttools/fix-cmap-subtable-sorting

[cmap] Fix subtable sorting crash and validate unique encoding records


Compare: https://github.com/fonttools/fonttools/compare/5da76d73514e...614863e321ad
Reply all
Reply to author
Forward
0 new messages