fontParts
fontParts copied to clipboard
Unexpected behavior in setStartSegment.
If a contour is open, setting the start segment closes the contour. It should not do this. If the contour is open, it should raise an error if the incoming index is not the last point in the contour. If it is the last point, set the start point by reversing the direction of the contour instead of reorganizing the points.
a small test case:
from fontParts.fontshell import RFont
f = RFont(showInterface=False)
g = f.newGlyph("a")
pen = g.getPen()
pen.moveTo((100, 100))
pen.lineTo((200, 200))
pen.endPath()
c = g[0]
print(c.points[0])
c.setStartSegment(-1)
print(c.points[0])