diff --git a/Lib/fontTools/feaLib/builder.py b/Lib/fontTools/feaLib/builder.py index 72156b8bb..52b23f1b2 100644 --- a/Lib/fontTools/feaLib/builder.py +++ b/Lib/fontTools/feaLib/builder.py @@ -828,7 +828,7 @@ class Builder(object): if prefix or suffix: chain = self.get_lookup_(location, ChainContextSubstBuilder) lookup = self.get_chained_lookup_(location, AlternateSubstBuilder) - chain.substitutions.append((prefix, [glyph], suffix, [lookup])) + chain.substitutions.append((prefix, [{glyph}], suffix, [lookup])) else: lookup = self.get_lookup_(location, AlternateSubstBuilder) if glyph in lookup.alternates: diff --git a/Tests/feaLib/builder_test.py b/Tests/feaLib/builder_test.py index 3273ba618..5ce4cc266 100644 --- a/Tests/feaLib/builder_test.py +++ b/Tests/feaLib/builder_test.py @@ -71,7 +71,7 @@ class BuilderTest(unittest.TestCase): ZeroValue_ChainSinglePos_horizontal ZeroValue_ChainSinglePos_vertical PairPosSubtable ChainSubstSubtable ChainPosSubtable LigatureSubtable AlternateSubtable MultipleSubstSubtable SingleSubstSubtable - aalt_chain_contextual_subst + aalt_chain_contextual_subst AlternateChained """.split() def __init__(self, methodName): diff --git a/Tests/feaLib/data/AlternateChained.fea b/Tests/feaLib/data/AlternateChained.fea new file mode 100644 index 000000000..45177693e --- /dev/null +++ b/Tests/feaLib/data/AlternateChained.fea @@ -0,0 +1,3 @@ +feature test { + sub A B a' [Y y] Z from [a.alt1 a.alt2 a.alt3]; +} test; diff --git a/Tests/feaLib/data/AlternateChained.ttx b/Tests/feaLib/data/AlternateChained.ttx new file mode 100644 index 000000000..e02bb7d43 --- /dev/null +++ b/Tests/feaLib/data/AlternateChained.ttx @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +