LettError/ufoProcessor

AttributeError: 'DesignSpaceProcessor' object has no attribute 'defaultLoc'

miguelsousa opened this issue · 3 comments

Updating to FontTools version 3.40.0 yields the error below. I assume it has something to do with this issue fonttools/fonttools#1554

@LettError any ideas on how to fix this?

Traceback (most recent call last):
  File "ufoProcessor/__init__.py", line 117, in build
    r = document.generateUFO(processRules=processRules)
  File "ufoProcessor/__init__.py", line 299, in generateUFO
    font = self.makeInstance(instanceDescriptor, processRules, glyphNames=glyphNames, pairs=pairs, bend=bend)
  File "ufoProcessor/__init__.py", line 625, in makeInstance
    kerningMutator = self.getKerningMutator()
  File "ufoProcessor/__init__.py", line 403, in getKerningMutator
    bias, self._kerningMutator = self.getVariationModel(kerningItems, axes=self.serializedAxes, bias=self.defaultLoc)
AttributeError: 'DesignSpaceProcessor' object has no attribute 'defaultLoc'

While working on this, the test files showed a change in the way axis maps handle the extremes.
It uses to be that if the extremes were not specifically mapped, they would map to themselves. So in the case of (Tests/test.py)
a.map = [(500,250)]
(0,0) and (1000,1000) were implied.
This does not seem to be the case anymore in fontTools. The extremes are no longer implied, and the default location maps to -250, and the test fails because there is no default font. It can be solved by explicitly adding the min and max values to the map.

@LettError thanks for the fix. I tested it and it works. Can I merge the defaultLoc_issue24 branch and issue a new release?

Good, yes thanks!