Created
June 23, 2015 21:08
-
-
Save ninastoessinger/c8eb9d0938584a277f90 to your computer and use it in GitHub Desktop.
RoboFont script to compare character sets of one UFO to another “master” UFO
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.interface.all.dialogs import SelectFont | |
markCounterpartsOfMissing = (1, 0, 0, 1) | |
# mark color for glyphs missing in the other font | |
# set to None for none, otherwise (r, g, b, a) tuple | |
f1 = SelectFont("Select 'Master' font:") | |
f2 = SelectFont("Select font to compare:") | |
if f1 is not None and f2 is not None: | |
missing = [] | |
for glyph in f1: | |
try: | |
otherGlyph = f2[glyph.name] | |
except: | |
missing.append(glyph.name) | |
print "%s misses the following glyphs compared to %s:" % (f2, f1) | |
missing = sorted(missing) | |
for m in missing: | |
print m | |
if markCounterpartsOfMissing is not None: | |
f1[m].mark = markCounterpartsOfMissing | |
else: | |
print "aborted" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment