Skip to content

Instantly share code, notes, and snippets.

@benkiel
Created November 30, 2011 16:12
Show Gist options
  • Save benkiel/1409640 to your computer and use it in GitHub Desktop.
Save benkiel/1409640 to your computer and use it in GitHub Desktop.
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()
for glyph in fonts[0]:
print glyph.name
if getDigest(glyph) == getDigest(fonts[1][glyph.name]):
glyph.mark = 1
fonts[1][glyph.name].mark = 1
for font in fonts:
font.update()
print 'done'
@benkiel
Copy link
Author

benkiel commented Nov 30, 2011

Re-done with digestPen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment