Robofab script problem

ttmt's picture

Robofab script problem

Hi all

I wrote this robofab script to adjust the height of accent - I know
there are other ways of doing this but I like this way.

This will move the accents up 5 points.


from robofab.world import CurrentFont
#
f = CurrentFont()
#
one = [

'Aacute',
'Abreve',
'Acircumflex',
'Adieresis',
'Agrave',
'Amacron',
'Atilde',
'AEacute',
'Aring',

]

#
for g in one:
f[g].components[1].move((0,5))
f[g].mark = 10

f.update()

I wanted to use the same code to move the accents down using -5 but I get an error

Traceback (most recent call last):
File "", line 86, in
IndexError: list index out of range


from robofab.world import CurrentFont
#
f = CurrentFont()
#
one = [

'Aacute',
'Abreve',
'Acircumflex',
'Adieresis',
'Agrave',
'Amacron',
'Atilde',
'AEacute',
'Aring',

]

#
for g in one:
f[g].components[1].move((0,-5))
f[g].mark = 10

f.update()

How can I move the accents down?

Mark Simonson's picture

It works when I try it. The error suggests that the problem is in your list of glyph names, of which you're only showing a few here. Maybe there is an error in one of the glyph names or a missing comma or something.

ttmt's picture

Thanks Mark, My mistake I thought I had the same glyphs in each array but the array in the decrease function was different.

Syndicate content Syndicate content