Fix normalization error when condition’s minimum/maximum are missing in designspace, update test too

Fixes #1346
This commit is contained in:
David Březina 2018-10-24 18:46:45 +02:00
parent 1a14b38de2
commit 28245afe1e
2 changed files with 10 additions and 4 deletions

View File

@ -587,8 +587,14 @@ def _add_GSUB_feature_variations(font, axes, internal_axis_supports, rules):
space = {}
for condition in conditions:
axis_name = condition["name"]
if condition["minimum"]:
minimum = normalize(axis_name, condition["minimum"])
else:
minimum = -1.0
if condition["maximum"]:
maximum = normalize(axis_name, condition["maximum"])
else:
maximum = 1.0
tag = axis_tags[axis_name]
space[tag] = (minimum, maximum)
region.append(space)

View File

@ -9,7 +9,7 @@
<rules>
<rule name="dollar-stroke">
<conditionset>
<condition name="weight" minimum="500" maximum="1000" />
<condition name="weight" minimum="500" /> <!-- intentionally omitted maximum -->
</conditionset>
<sub name="uni0024" with="uni0024.nostroke" />
</rule>