New to Typophile? Accounts are free, and easy to set up.
Hi all,
Is it possible to use RoboFab control the sidebearing of glyphs.
I was thinking something like this might work.
This code just prints the sidebearing - 20, what I really wanted to do is decrease the left sidebearing by 20.
from robofab.world import CurrentFont
f = CurrentFont()
A = f['A'].leftMargin
A-=20
print A
f.update()
8 Mar 2008 — 10:08am
Have you tried this?
print "before", f['A'].leftMarginf['A'].leftMargin = f['A'].leftMargin -20print "after", f['A'].leftMargin8 Mar 2008 — 2:41pm
That's easy to do in Font Lab also. Select the glyphs you want to change, and then go to: actions/metrics/set side bearings.
8 Mar 2008 — 3:43pm
k.l.
Thanks that worked, still getting to grips with the RoboFab syntax
I think I was trying to do this with my first attempt.
from robofab.world import CurrentFont
f = CurrentFont()
f['A'].leftMargin -=20
f.update()
17 Apr 2012 — 1:53pm
How can I do the same, but using the 'measurement line'?
I mean: To measures the distance from, let say, the middle of the x-height instead if the first left point.
23 Apr 2012 — 1:07pm
Pablo, have a look at the marginPen module in RoboFab/pens. It will calculate the margins of a glyph at a requested height (or width)
link to marginPen.py on code.robofab.com
23 Apr 2012 — 3:53pm
Erik, thanks!
marginPen is awesome.
I'm working on a spacing macro, will release it shortly.