Skip to content

Instantly share code, notes, and snippets.

@marcdama
marcdama / FL: From selected Glyphs: Highlight Component Glyphs used to build the selected glyphs
Last active August 29, 2015 14:19
FL: From selected Glyphs: Highlight Component Glyphs used to build the selected glyphs
from robofab.world import *
f = CurrentFont()
g = f.selection[0]
for i in f:
for j in i.components:
if j.baseGlyph == g:
i.mark = 1
@marcdama
marcdama / gist:b765c7fcc7274239e6a5
Created April 19, 2015 14:09
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
@marcdama
marcdama / Add anchors to base
Last active August 29, 2015 14:19
add anchors to base glyph
from robofab.world import *
f = CurrentFont()
f['BASE'].appendAnchor('dTop',(311,591))
f['BASE'].appendAnchor('dCand',(311,631))
f['BASE'].appendAnchor('dBottom',(311,-20))
f['BASE'].appendAnchor('dNukta',(0,100))
f.update()
print 'done'
@marcdama
marcdama / Add Below Marks to selection
Last active August 29, 2015 14:19
Devanagari add dBottom to glyphs which do not have this anchor
from robofab.world import *
f = CurrentFont()
g_anc = {}
for i in f.selection:
g_anc[f[i].name] = []
for j in f[i].anchors:
g_anc[f[i].name].append(j.name)
from robofab.world import *
f = CurrentFont()
for i in f.selection:
if f[i].box[0] < 40:
f[i].mark = 10
if f[i].box[0] > 960 :
f[i].mark[2] = 10
from robofab.world import *
f = CurrentFont()
for i in f.selection:
if f[i].width == 1000:
f[i].mark = 10
f.update()