ttGlyphPen: handle open contours starting with 'move'; treat them as if they were closed

Fixes #2365
This commit is contained in:
Cosimo Lupo 2021-07-15 18:25:19 +01:00
parent 0dc2a2a13f
commit 934349a9c5

View File

@ -275,10 +275,11 @@ class TTGlyphPointPen(_TTGlyphBasePen, LogMixin, AbstractPointPen):
raise PenError("Can't add a point to a closed contour.")
if segmentType is None:
self.types.append(0) # offcurve
elif segmentType in ("qcurve", "line"):
elif segmentType in ("qcurve", "line", "move"):
self.types.append(1) # oncurve
elif segmentType == "curve":
raise NotImplementedError("cubic curves are not supported")
else:
# cubic curves are not supported
raise NotImplementedError
raise AssertionError(segmentType)
self.points.append(pt)