Add missing location argument

and make code nicer.
This commit is contained in:
Nikolaus Waxweiler 2023-03-14 18:24:45 +00:00
parent f926909fef
commit d1b916ad04
2 changed files with 5 additions and 4 deletions

View File

@ -2065,7 +2065,7 @@ class ConditionsetStatement(Statement):
self.conditions = conditions
def build(self, builder):
builder.add_conditionset(self.name, self.conditions)
builder.add_conditionset(self.location, self.name, self.conditions)
def asFea(self, res="", indent=""):
res += indent + f"conditionset {self.name} " + "{\n"

View File

@ -1568,10 +1568,11 @@ class Builder(object):
def add_vhea_field(self, key, value):
self.vhea_[key] = value
def add_conditionset(self, key, value):
if not "fvar" in self.font:
def add_conditionset(self, location, key, value):
if "fvar" not in self.font:
raise FeatureLibError(
"Cannot add feature variations to a font without an 'fvar' table"
"Cannot add feature variations to a font without an 'fvar' table",
location,
)
# Normalize