Print selected glyphs python/macro?

RachelR's picture

I'm looking for a simple way to print into output window the glyphs I have selected.

I wrote this to select pre defined groups - like using classes but simpler

from robofab.world import CurrentFont
f = CurrentFont()
#
#
myGlyphs = ['A','Amacron','Abreve','Aogonek','Agrave','Aacute','Acircumflex','Atilde','Adieresis','Aring']
#
for glyphName in myGlyphs:
f[glyphName].selected = 1
f[glyphName].update()
#
f.update()

Now I'm trying to do the other way so groups of glyphs I select will be printed in the output window - I was trying something like this.

from robofab.world import CurrentFont
f = CurrentFont()

toPrint = f.selected
print toPrint.name

f.update()

RachelR's picture

If it's any help to anyone I worked it out


from robofab.world import CurrentGlyph, CurrentFont
f = CurrentFont()

for g in f:
if g.selected == 1:
print g.name

f.update()

Syndicate content Syndicate content