Skip to content

Instantly share code, notes, and snippets.

@marcdama
Created April 19, 2015 14:09
Show Gist options
  • Select an option

  • Save marcdama/b765c7fcc7274239e6a5 to your computer and use it in GitHub Desktop.

Select an option

Save marcdama/b765c7fcc7274239e6a5 to your computer and use it in GitHub Desktop.
From selected glyphs: Print individual glyphs components/order and structure to be remade with FL Generate glyph (CTRL+G)
from robofab.world import *
f = CurrentFont()
def flat_list(*n):
stringer = ''
if len(n) == 1:
stringer += str(n[0])
return stringer
for i in n:
stringer += '_%s' %i
return stringer[1:]
hash = {}
for i in f.selection:
if f[i].components:
hash[f[i].name] = []
for j in f[i].components:
hash[f[i].name].append(j.baseGlyph)
for i in hash:
print '%s=%s' %(flat_list(*hash[i]), i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment