Can anybody help me with a RoboFab script?

Primary tabs

4 posts / 0 new
Last post
rui abreu's picture
Joined: 11 Apr 2006 - 11:50am
Can anybody help me with a RoboFab script?

I'm tying to make a small script with robafab far a multiple master Font.
Basically my script will move a component inside a diacritic glyph.

For intance moving the "acute" accent inside "oacute".
This is the script:

from import CurrentFont
f = CurrentFont()

g = f["oacute"]

The problem is:
Since my font is a multiple master with two weight masters, when I run this script, it moves the accent in the both masters.

Is there any way to move the accent only in one of the masters?

Thanks in advanced.

Paul van der Laan's picture
Joined: 4 Mar 2007 - 8:56am

As far as I know, RoboFab is not able to deal with individual instances in a multiple master file. You might be able to achieve your goal by using FontLab’s native Python implementation instead.

Otherwise, why not use anchors for placing accents? If done correctly it will save you the hassle of dealing with individual accented glyphs.

-Paul van der Laan

rui abreu's picture
Joined: 11 Apr 2006 - 11:50am

Yes I think it is not possible to deal with individual instances with Robofab.

I've never used ancors, but I check it out and it seems great. Thanks for the sugestion, this was something I didn't know.

Anton's picture
Joined: 14 May 2010 - 2:27pm


Couple of years too late, but maybe can help someone.
It is possible to move component inside MM font. I made those based on typical fontlab scripts. Karsten Lucke have some nice MM helpers.

Here comes code, dont forget indetation in the "for loop" and if/else.

PS. Does someone have a good method how to "append" a component inside MM fglyph?
I've tried many methods, but so far no luck.

#FLM: Move MM compnt 1
# made by AK 2010
# to move component in single master

from FL import *
from import CurrentGlyph
rfg = CurrentGlyph()

g = fl.glyph
m = fl.master

# here specify amount and what to move
xmov = -50
# first identify FL component index! Name wont work.
compnt = 14

print "master:", m

for n in g.components:
if n.index == compnt:
print "there is specific compnt to move"
n.deltas[m].x += xmov
print "use compo tester to get to know:"

print "manipul in action"