Skip to content

Commit

Permalink
Round instance kerning data when asked.
Browse files Browse the repository at this point in the history
doc.makeInstance() did not round the instance kerning data when the roundGeometry flag was set.
  • Loading branch information
LettError committed Oct 18, 2024
1 parent 238b8cf commit 3d4befa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/ufoProcessor/ufoOperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@ def makeInstance(self, instanceDescriptor,
locHorizontal, locVertical = self.splitAnisotropic(loc)
if self.debug:
self.logger.info(f"\t\t\tAnisotropic location for \"{instanceDescriptor.name}\"\n\t\t\t{fullDesignLocation}")

# makeOneKerning
# discreteLocation ?
if instanceDescriptor.kerning:
Expand Down Expand Up @@ -1321,7 +1322,6 @@ def makeInstance(self, instanceDescriptor,
# each key in the location is the libKey
# each value is the calculated value
libMathDict = libMathMutator.makeInstance(locHorizontal)
#print("libMathDict", locHorizontal, libMathDict)
if libMathDict:
for libKey, mutatedValue in libMathDict.items():
# only add the value to the lib if it is not 0.
Expand Down Expand Up @@ -1657,6 +1657,8 @@ def makeOneKerning(self, location, pairs=None):
# extract the object later
if self.debug:
self.logger.info(f"\t\t\t\t{len(kerningObject.keys())} kerning pairs added")
if self.roundGeometry:
kerningObject.round()
if self.debug:
if kerningObject is not None:
self.logger.info(f"\t\t\t\tmakeOneKerning outcome: {kerningObject.items()}")
Expand Down

0 comments on commit 3d4befa

Please sign in to comment.