Branch: refs/heads/merge-single-subst-chained-rules
Home:
https://github.com/fonttools/fonttools
Commit: 4f7747ece986dc2dc1b48de905e1a03dc4224373
https://github.com/fonttools/fonttools/commit/4f7747ece986dc2dc1b48de905e1a03dc4224373
Author: Cosimo Lupo <
cl...@google.com>
Date: 2026-03-12 (Thu, 12 Mar 2026)
Changed paths:
M Lib/fontTools/feaLib/builder.py
Log Message:
-----------
Merge consecutive contextual rules with same context
Add _merge_contextual_rule() helper that merges consecutive contextual
rules sharing the same prefix, suffix, and lookups into a single rule
with broader input coverage. Applied to all contextual builder methods:
add_chain_context_subst, add_chain_context_pos, add_single_subst_chained_,
add_multi_subst_chained_, and add_single_pos_chained_.
This matches the broad merge strategy used by fea-rs, which merges all
contextual rule types in its shared ContextBuilder::add().
Fixes
https://github.com/fonttools/fonttools/issues/4016
Commit: 3666aaea559221948ed73d1441bac054bd2db1ec
https://github.com/fonttools/fonttools/commit/3666aaea559221948ed73d1441bac054bd2db1ec
Author: Cosimo Lupo <
cl...@google.com>
Date: 2026-03-12 (Thu, 12 Mar 2026)
Changed paths:
M Tests/feaLib/builder_test.py
M Tests/feaLib/data/bug463.ttx
M Tests/feaLib/data/bug512.ttx
A Tests/feaLib/data/contextual_merge_gpos_named.fea
A Tests/feaLib/data/contextual_merge_gpos_named.ttx
A Tests/feaLib/data/contextual_merge_gsub_named.fea
A Tests/feaLib/data/contextual_merge_gsub_named.ttx
A Tests/feaLib/data/contextual_merge_ignore.fea
A Tests/feaLib/data/contextual_merge_ignore.ttx
M Tests/feaLib/data/feature_aalt.ttx
Log Message:
-----------
Add tests for contextual rule merge optimization
Update expected TTX output for bug463, bug512, and feature_aalt to
reflect merged contextual rules (fewer subtables, broader input
coverage).
Add new test cases for contextual rule merge beyond inline multi-subst:
- GSUB contextual substitution with named lookup references
- GPOS contextual positioning with named lookup references
- Ignore rules with no nested lookups
Compare:
https://github.com/fonttools/fonttools/compare/4f7747ece986%5E...3666aaea5592
To unsubscribe from these emails, change your notification settings at
https://github.com/fonttools/fonttools/settings/notifications