casasin
6/25/2015 - 11:40 AM

Compare all open fonts glyphOrder to the current font's.

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