A move point is only allowed as the first point.
git-svn-id: http://svn.robofab.com/branches/ufo3k@324 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
This commit is contained in:
parent
dee7ce676d
commit
5c2e634bbf
@ -687,7 +687,7 @@ def buildOutline(pen, xmlNodes, formatVersion, identifiers):
|
|||||||
pen.beginPath()
|
pen.beginPath()
|
||||||
raise DeprecationWarning("The beginPath method needs an identifier kwarg. The contour's identifier value has been discarded.")
|
raise DeprecationWarning("The beginPath method needs an identifier kwarg. The contour's identifier value has been discarded.")
|
||||||
# points
|
# points
|
||||||
for subElement, attrs, dummy in children:
|
for index, (subElement, attrs, dummy) in enumerate(children):
|
||||||
# unknwon child element of contour
|
# unknwon child element of contour
|
||||||
if subElement != "point":
|
if subElement != "point":
|
||||||
raise GlifLibError("Unknown child element (%s) of contour element." % subElement)
|
raise GlifLibError("Unknown child element (%s) of contour element." % subElement)
|
||||||
@ -712,6 +712,9 @@ def buildOutline(pen, xmlNodes, formatVersion, identifiers):
|
|||||||
raise GlifLibError("Unknown point type: %s" % segmentType)
|
raise GlifLibError("Unknown point type: %s" % segmentType)
|
||||||
if segmentType == "offcurve":
|
if segmentType == "offcurve":
|
||||||
segmentType = None
|
segmentType = None
|
||||||
|
# move can only occur as the first point
|
||||||
|
if segmentType == "move" and index != 0:
|
||||||
|
raise GlifLibError("A move point occurs after the first point in the contour.")
|
||||||
# smooth is not required
|
# smooth is not required
|
||||||
smooth = attrs.get("smooth", "no")
|
smooth = attrs.get("smooth", "no")
|
||||||
if smooth is not None:
|
if smooth is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user