Merge pull request #2734 from fonttools/instancer-bug
[instancer] Fix bug in _instantiateFeatureVariations()
This commit is contained in:
commit
e3aaf59084
@ -805,12 +805,12 @@ def _instantiateFeatureVariationRecord(
|
|||||||
return applies, shouldKeep
|
return applies, shouldKeep
|
||||||
|
|
||||||
|
|
||||||
def _limitFeatureVariationRecord(record, axisRanges, fvarAxes):
|
def _limitFeatureVariationRecord(record, axisRanges, axisOrder):
|
||||||
newConditions = []
|
newConditions = []
|
||||||
for i, condition in enumerate(record.ConditionSet.ConditionTable):
|
for i, condition in enumerate(record.ConditionSet.ConditionTable):
|
||||||
if condition.Format == 1:
|
if condition.Format == 1:
|
||||||
axisIdx = condition.AxisIndex
|
axisIdx = condition.AxisIndex
|
||||||
axisTag = fvarAxes[axisIdx].axisTag
|
axisTag = axisOrder[axisIdx]
|
||||||
if axisTag in axisRanges:
|
if axisTag in axisRanges:
|
||||||
axisRange = axisRanges[axisTag]
|
axisRange = axisRanges[axisTag]
|
||||||
newRange = _limitFeatureVariationConditionRange(condition, axisRange)
|
newRange = _limitFeatureVariationConditionRange(condition, axisRange)
|
||||||
@ -854,7 +854,7 @@ def _instantiateFeatureVariations(table, fvarAxes, axisLimits):
|
|||||||
record, i, location, fvarAxes, axisIndexMap
|
record, i, location, fvarAxes, axisIndexMap
|
||||||
)
|
)
|
||||||
if shouldKeep:
|
if shouldKeep:
|
||||||
shouldKeep = _limitFeatureVariationRecord(record, axisRanges, fvarAxes)
|
shouldKeep = _limitFeatureVariationRecord(record, axisRanges, axisOrder)
|
||||||
|
|
||||||
if shouldKeep and _featureVariationRecordIsUnique(record, uniqueRecords):
|
if shouldKeep and _featureVariationRecordIsUnique(record, uniqueRecords):
|
||||||
newRecords.append(record)
|
newRecords.append(record)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user