From abae80d7305caf5739d701b92a2ca4edeaf87455 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 13 Mar 2019 15:11:53 +0000 Subject: [PATCH] [feaLib] make 'forceChain' an optional kwarg for barkward compat See discussion at: https://github.com/fonttools/fonttools/pull/1511#issuecomment-472425283 --- Lib/fontTools/feaLib/ast.py | 4 +++- Lib/fontTools/feaLib/builder.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/feaLib/ast.py b/Lib/fontTools/feaLib/ast.py index 3f3bbf883..5289b1002 100644 --- a/Lib/fontTools/feaLib/ast.py +++ b/Lib/fontTools/feaLib/ast.py @@ -905,7 +905,9 @@ class MarkMarkPosStatement(Statement): class MultipleSubstStatement(Statement): - def __init__(self, prefix, glyph, suffix, replacement, forceChain, location=None): + def __init__( + self, prefix, glyph, suffix, replacement, forceChain=False, location=None + ): Statement.__init__(self, location) self.prefix, self.glyph, self.suffix = prefix, glyph, suffix self.replacement = replacement diff --git a/Lib/fontTools/feaLib/builder.py b/Lib/fontTools/feaLib/builder.py index 280eba7fb..456ae3cc7 100644 --- a/Lib/fontTools/feaLib/builder.py +++ b/Lib/fontTools/feaLib/builder.py @@ -881,7 +881,7 @@ class Builder(object): lookup.ligatures[g] = replacement def add_multiple_subst(self, location, - prefix, glyph, suffix, replacements, forceChain): + prefix, glyph, suffix, replacements, forceChain=False): if prefix or suffix or forceChain: chain = self.get_lookup_(location, ChainContextSubstBuilder) sub = self.get_chained_lookup_(location, MultipleSubstBuilder)