Skip to content

Instantly share code, notes, and snippets.

@casasin
Created June 25, 2015 11:40
Show Gist options
  • Save casasin/f1df848b5c3bb0e8ed60 to your computer and use it in GitHub Desktop.
Save casasin/f1df848b5c3bb0e8ed60 to your computer and use it in GitHub Desktop.
Compare all open fonts glyphOrder to the current font's.
# compareGlyphOrders.py
"""
Compare all open fonts glyphOrder to the current font's.
"""
current = CurrentFont()
fonts = AllFonts()[1:]
currentSet = set(current.keys())
print '- MASTER: %s-%s, %s glyphs' % (current.info.familyName, current.info.styleName, len(current))
for f in fonts:
print '\n\t%s-%s: %s glyphs' % (f.info.familyName, f.info.styleName, len(f))
fSet = set(f.keys())
missingSet = currentSet.difference(fSet)
additionalSet = fSet.difference(currentSet)
print '\t' + '=' * 30
print '\tMISSING:\n\t', ' '.join(list(missingSet))
print '\t' + '=' * 30
print '\tADDITIONAL:\n\t', ' '.join(list(additionalSet))
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment