glyf: use 'round' parameter in _getCoordinatesAndControls

as Behdad suggested in review
This commit is contained in:
Cosimo Lupo 2023-06-08 11:47:47 +01:00
parent 5c0f05cc42
commit dfec4abf6d
No known key found for this signature in database
GPG Key ID: DF65A8A5A119C9A8
2 changed files with 4 additions and 4 deletions

View File

@ -372,7 +372,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
]
def _getCoordinatesAndControls(
self, glyphName, hMetrics, vMetrics=None, roundCoordinates=True
self, glyphName, hMetrics, vMetrics=None, *, round=otRound
):
"""Return glyph coordinates and controls as expected by "gvar" table.
@ -446,8 +446,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
# Add phantom points for (left, right, top, bottom) positions.
phantomPoints = self._getPhantomPoints(glyphName, hMetrics, vMetrics)
coords.extend(phantomPoints)
if roundCoordinates:
coords.toInt()
coords.toInt(round=round)
return coords, controls
def _setCoordinates(self, glyphName, coord, hMetrics, vMetrics=None):

View File

@ -1,4 +1,5 @@
from fontTools.misc.fixedTools import floatToFixedToFloat
from fontTools.misc.roundTools import noRound
from fontTools.misc.testTools import stripVariableItemsFromTTX
from fontTools.misc.textTools import Tag
from fontTools import ttLib
@ -57,7 +58,7 @@ def _get_coordinates(varfont, glyphname):
varfont["hmtx"].metrics,
varfont["vmtx"].metrics,
# the tests expect float coordinates
roundCoordinates=False,
round=noRound,
)[0]
)