[fonttools/fonttools] a8d17f: [varLib] Support beyond-64k extended formats in OT...

1 view
Skip to first unread message

Cosimo Lupo

unread,
Jun 17, 2026, 5:18:28 PM (8 days ago) Jun 17
to fontto...@googlegroups.com
Branch: refs/heads/beyond-64k
Home: https://github.com/fonttools/fonttools
Commit: a8d17f538ecb4ff2cbe06c85c2cc6a15b799945f
https://github.com/fonttools/fonttools/commit/a8d17f538ecb4ff2cbe06c85c2cc6a15b799945f
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/varLib/__init__.py
M Lib/fontTools/varLib/merger.py

Log Message:
-----------
[varLib] Support beyond-64k extended formats in OTL merger

The OTL mergers dispatch on the format 1/2 GPOS subtable layouts, so
merging masters whose GPOS uses the beyond-64k extended layouts (PairPos/
SinglePos format 3/4, mark/cursive format 2) raised UnsupportedFormat. feaLib
promotes a master's layout to these by glyph count, so every master of a font
with more than 65535 glyphs is already extended.

Demote the extended GPOS subtables to format 1/2 before merging and promote
the merged output back afterwards, reusing the converter in ttLib.beyond64k;
only the records that embed glyph ids/counts/offsets are reclassed (Coverage and
ClassDef pick their wire format at compile time). This lives in the shared Lookup
merger, so it covers both varLib.build and the instancer's per-master OTL merge.
Contextual positioning, mark-to-ligature and GSUB go through the generic object
walker and are left as-is.

Also let _merge_OTL attach the VarStore to a beyond-64k v1.4 GDEF without
asserting v1.2 or dropping its extended fields.


Commit: 9ce7d036dc69d0bb7e2178d52b3ecbfa3bcb06b3
https://github.com/fonttools/fonttools/commit/9ce7d036dc69d0bb7e2178d52b3ecbfa3bcb06b3
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Tests/varLib/varLib_test.py

Log Message:
-----------
[varLib] Test beyond-64k GPOS/GDEF merging

Build a beyond-64k VF through the per-master OTL fallback path: one test
round-trips the whole font and checks all five GPOS lookup types come out in the
extended formats with the high glyph id intact and the GDEF VarStore at v1.4; the
other checks PairPos coverage alignment and backfill across disjoint masters.
Interpolated values are resolved against the VarStore.


Commit: 3626a2ef5095f482832f4adeca6032924ad58077
https://github.com/fonttools/fonttools/commit/3626a2ef5095f482832f4adeca6032924ad58077
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/varLib/merger.py
M Tests/varLib/varLib_test.py

Log Message:
-----------
[varLib.merger] Merge beyond-64k v1.4 GDEF GlyphClassDef2 leniently

The lenient GDEF merger that unions per-master glyph class assignments was
keyed on the GlyphClassDef attribute only, so a beyond-64k v1.4 GDEF stores
its class def in GlyphClassDef2 and fell through to the strict generic merge,
raising ShouldBeConstant whenever masters diverged (even on non-conflicting
glyphs). Register the merger for both names so v1.4 fonts get the same union
semantics v1.2 always had.


Compare: https://github.com/fonttools/fonttools/compare/e20998b89c0a...3626a2ef5095

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