Skip to content

Commit

Permalink
Do not re-cycle the outline in strict mode (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens authored Jul 24, 2024
1 parent b292855 commit cc1eb8c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Lib/fontMath/mathGlyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit cc1eb8c

Please sign in to comment.