From cc1eb8cb36f674954771a1d206d0fd193fd43c0a Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Wed, 24 Jul 2024 17:11:52 +0100 Subject: [PATCH] Do not re-cycle the outline in strict mode (#325) --- Lib/fontMath/mathGlyph.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Lib/fontMath/mathGlyph.py b/Lib/fontMath/mathGlyph.py index 1b31c7c..ab7a27b 100644 --- a/Lib/fontMath/mathGlyph.py +++ b/Lib/fontMath/mathGlyph.py @@ -381,18 +381,19 @@ def _flushContour(self): contourPoints = self.contours[-1]["points"] points = self._points # move offcurves at the beginning of the contour to the end - haveOnCurve = False - for point in points: - if point[0] is not None: - haveOnCurve = True - break - if haveOnCurve: - while 1: - if points[0][0] is None: - point = points.pop(0) - points.append(point) - else: + if not self.strict: + haveOnCurve = False + for point in points: + if point[0] is not None: + haveOnCurve = True break + if haveOnCurve: + while 1: + if points[0][0] is None: + point = points.pop(0) + points.append(point) + else: + break # convert lines to curves holdingOffCurves = [] for index, point in enumerate(points):