diff options
Diffstat (limited to 'scripts/lib/fontbuild/curveFitPen.py')
-rw-r--r-- | scripts/lib/fontbuild/curveFitPen.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/lib/fontbuild/curveFitPen.py b/scripts/lib/fontbuild/curveFitPen.py index c2b90ac..f7c0cae 100644 --- a/scripts/lib/fontbuild/curveFitPen.py +++ b/scripts/lib/fontbuild/curveFitPen.py @@ -280,6 +280,14 @@ class SubsegmentPen(BasePen): def _closePath(self): if not (self.lastPoint[0] == self.startContour[0] and self.lastPoint[1] == self.startContour[1]): self._lineTo(self.startContour) + + # round values used by otherPen (a RoboFab SegmentToPointPen) to decide + # whether to delete duplicate points at start and end of contour + #TODO(jamesgk) figure out why we have to do this hack, then remove it + c = self.otherPen.contour + for i in [0, -1]: + c[i] = [[round(n, 5) for n in c[i][0]]] + list(c[i][1:]) + self.otherPen.closePath() def _endPath(self): |