MarginPen strange behaviour on Start Points

13 views
Skip to first unread message

Telex

unread,
Apr 23, 2014, 1:31:24 PM4/23/14
to rob...@googlegroups.com
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



Georg Seifert

unread,
Apr 23, 2014, 4:11:57 PM4/23/14
to rob...@googlegroups.com
This was a problem in the Glyphs pen drawing wrapper. I have fixed it. Please get the latest version of the wrapper file: https://github.com/schriftgestalt/Glyphs-Scripts

Georg

Andrés Torresi

unread,
Apr 23, 2014, 4:38:11 PM4/23/14
to rob...@googlegroups.com
Thanks Georg!!!
I was struggling with this and spent many time thinking it was a mistake.
You helped me a lot.

Erik van Blokland

unread,
Apr 24, 2014, 1:38:09 AM4/24/14
to rob...@googlegroups.com
Andrés,
you mentioned FontLab as well - is that a separate problem?
Erik
> --
> --
> You received this message because you are subscribed to the Google Groups "RoboFab" group.
> To post to this group, send email to rob...@googlegroups.com
> To unsubscribe from this group, send email to robofab-u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/robofab?hl=en
>
> Messages from newly joined members are subject to moderation.
> Download RoboFab and documentation at http://robofab.com
> --- You received this message because you are subscribed to the Google Groups "RoboFab" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to robofab+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Andrés Torresi

unread,
Apr 24, 2014, 11:27:14 AM4/24/14
to rob...@googlegroups.com
I will check it again, but I think I had that problem.

Andrés Torresi

unread,
Apr 24, 2014, 11:33:56 AM4/24/14
to rob...@googlegroups.com
I thought it was a problem in FL also, but it seems to work ok.
Thanks Eric.

On 24/04/14 02:38, Erik van Blokland wrote:
Reply all
Reply to author
Forward
0 new messages