Robofab move Component

23 views
Skip to first unread message

ttmt

unread,
May 25, 2015, 2:32:58 AM5/25/15
to rob...@googlegroups.com
Hi all

I have a macro that I used to change the position of components in glyphs.


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

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

]

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

f.update()


If I try and use it now I get an error 

Traceback (most recent call last):
  File "<string>", line 85, in <module>
IndexError: list index out of range

Does anyone know why I'm getting this error or how to fix it.

joancarles casasín

unread,
May 25, 2015, 3:20:22 AM5/25/15
to RoboFab List

Maybe you're calling a glyph with no components?

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

?


joancarles


El 25/05/2015, a les 8.32, ttmt <ttm...@googlemail.com> va escriure:
- - - - - - - - - - -
Joancarles Casasín
Lletres, números i signes de puntuació
www.casasin.com

Georg Seifert

unread,
Jun 24, 2015, 9:37:00 AM6/24/15
to rob...@googlegroups.com
can you get the latest version of the robofab wrapper from https://github.com/schriftgestalt/Glyphs-Scripts (the file objectsGS.py)
Reply all
Reply to author
Forward
0 new messages