[fonttools/fonttools] b3e9ab: [mort] Decode trimmed contextual substitution windows

0 views
Skip to first unread message

Cosimo Lupo

unread,
Aug 25, 2026, 9:08:31 AM (17 hours ago) Aug 25
to fontto...@googlegroups.com
Branch: refs/heads/fix-mort-contextual-windows
Home: https://github.com/fonttools/fonttools
Commit: b3e9abecd8e19b93e5ec0fdd0f37eee839ade270
https://github.com/fonttools/fonttools/commit/b3e9abecd8e19b93e5ec0fdd0f37eee839ade270
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-08-25 (Tue, 25 Aug 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/otConverters.py
M Tests/ttLib/tables/_m_o_r_t_test.py

Log Message:
-----------
[mort] Decode trimmed contextual substitution windows

The classic contextual format resolves a substitution by adding the entry's
word offset (possibly negative) to the glyph ID, so each offset exposes a
per-glyph window rather than a whole lookup table, and real fonts (e.g.
macOS's CharcoalCY, GenevaCY, HelveticaCY) trim those windows to the glyphs
an entry can apply to. Decode only the words that fall inside the
substitution table instead of reading a full per-glyph array and rejecting
offsets that precede it. The window is clamped to the subtable, slightly
stricter than HarfBuzz's blob-wide upper bound.



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