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
This commit is contained in:
jvr 2001-08-16 11:02:05 +00:00
parent 239498a496
commit aa00a279ae

View File

@ -400,11 +400,11 @@ class T2OutlineExtractor(SimpleT2Decompiler):
def appendPoint(self, point, isPrimary): def appendPoint(self, point, isPrimary):
import Numeric import Numeric
point = self.currentPoint + Numeric.array(point, Numeric.Int16) point = self.currentPoint + Numeric.array(point, Numeric.Int16)
if not self.contours: if not self.contours or self.contours[-1][2]:
# The glyph doesn't start with a moveto. Not sure whether # The subpath doesn't start with a moveto. Not sure whether
# this is legal, but apparently it usually works. # this is legal, but apparently it usually works.
self.newPath() self.newPath()
self.appendPoint(self.currentPoint, 1) self.appendPoint((0, 0), 1)
self.currentPoint = point self.currentPoint = point
points, flags, isClosed = self.contours[-1] points, flags, isClosed = self.contours[-1]
points.append(point) points.append(point)