Created
November 30, 2011 16:12
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Re-done with digestPen