From aa00a279aee4fb40429fbcf874f61d26a9978973 Mon Sep 17 00:00:00 2001 From: jvr Date: Thu, 16 Aug 2001 11:02:05 +0000 Subject: [PATCH] behave nicely when *any* subpath doesn't start with a moveto. git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@171 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/misc/psCharStrings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/misc/psCharStrings.py b/Lib/fontTools/misc/psCharStrings.py index 1fa597cbc..a65013901 100644 --- a/Lib/fontTools/misc/psCharStrings.py +++ b/Lib/fontTools/misc/psCharStrings.py @@ -400,11 +400,11 @@ class T2OutlineExtractor(SimpleT2Decompiler): def appendPoint(self, point, isPrimary): import Numeric point = self.currentPoint + Numeric.array(point, Numeric.Int16) - if not self.contours: - # The glyph doesn't start with a moveto. Not sure whether + if not self.contours or self.contours[-1][2]: + # The subpath doesn't start with a moveto. Not sure whether # this is legal, but apparently it usually works. self.newPath() - self.appendPoint(self.currentPoint, 1) + self.appendPoint((0, 0), 1) self.currentPoint = point points, flags, isClosed = self.contours[-1] points.append(point)