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

0 views
Skip to first unread message

Cosimo Lupo

unread,
Mar 5, 2026, 12:37:12 PM (6 days ago) Mar 5
to fontto...@googlegroups.com
Branch: refs/heads/fix-cmap-subtable-sorting
Home: https://github.com/fonttools/fonttools
Commit: efb90ee783c637d8b8ea6843ea10b6bd1ee6dc1b
https://github.com/fonttools/fonttools/commit/efb90ee783c637d8b8ea6843ea10b6bd1ee6dc1b
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: a49858ff46141d1c34051f64ea52b22099e78517
https://github.com/fonttools/fonttools/commit/a49858ff46141d1c34051f64ea52b22099e78517
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/efb90ee783c6%5E...a49858ff4614

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