fontParts icon indicating copy to clipboard operation
fontParts copied to clipboard

Unexpected behavior in setStartSegment.

Open typesupply opened this issue 6 years ago • 1 comments

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.

typesupply avatar Feb 12 '19 20:02 typesupply

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])

typemytype avatar Feb 13 '19 08:02 typemytype