Changed paths:
M Lib/fontTools/feaLib/builder.py
M Lib/fontTools/otlLib/builder.py
M Tests/feaLib/builder_test.py
A Tests/feaLib/data/contextual_merge_alternate.fea
A Tests/feaLib/data/contextual_merge_alternate.ttx
Log Message:
-----------
Reuse and merge chained alternate subst lookups
Add find_chainable_alternate_subst() to find an existing AlternateSubst
lookup that can accommodate a new glyph without conflict. This allows
consecutive chained alternate rules to share a single nested lookup and
merge into one contextual rule via _merge_contextual_rule().
Previously each chained alternate rule unconditionally created a fresh
AlternateSubstBuilder, preventing both lookup reuse and rule merging.