Hi!
I noticed that MarginPen returns different values depending on the start point position.
I mean, when the segment is the first in the contour, the value is not correct, or not well calculated.
If I change the Start Point position (so the segment is not the first one anymore), margin value seems right.
It happens to me in Fontlab and Glyphs.
Did anyone notice that? Or am I doing something wrong?
My simple code:
f=CurrentFont()
def getMargins(g, y):
pen = MarginPen(g, y, True)
g.draw(pen)
crossings = pen.getMargins()
try:
margins = (crossings[0], crossings[1])
except:
margins = (None, None)
return margins
print getMargins(f['o'],100)
Graphic explanation below