Skip to content

Instantly share code, notes, and snippets.

@ninastoessinger
Created June 23, 2015 21:08
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ninastoessinger/c8eb9d0938584a277f90 to your computer and use it in GitHub Desktop.
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
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