Skip to content

Instantly share code, notes, and snippets.

View benkiel's full-sized avatar

Ben Kiel benkiel

View GitHub Profile
@benkiel
benkiel / find_if_font_uses_component.py
Created December 7, 2011 16:47
Goes through all open fonts to find out if the font uses a component. Useful to run if you're thinking of changing the spacing of a accent and you don't want everything to go all wonky.
from robofab.world import AllFonts
fonts = AllFonts()
for font in fonts:
print font.info.postscriptFullName
for glyph in font:
if len(glyph.components) != 0:
for c in glyph.components:
if c.baseGlyph == 'uni0361':
@benkiel
benkiel / compare_glyph_structure.py
Created November 30, 2011 16:12
Small RoboFab script to mark glyphs that share the same structure between two fonts
from robofab.world import AllFonts
from robofab.pens.digestPen import DigestPointPen
fonts = AllFonts()
def getDigest(glyph):
pen = DigestPointPen()
glyph.drawPoints(pen)
return pen.getDigest()