Created
September 2, 2018 12:02
-
-
Save arialcrime/23b744afd9da8e05b660331640b2b507 to your computer and use it in GitHub Desktop.
Quick script to check glyph sets of fonts against each other
This file contains hidden or 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 mojo.UI import GetFile | |
| font_paths = GetFile(allowsMultipleSelection=True) | |
| fonts = FontsList() | |
| for font_path in font_paths: | |
| f = OpenFont(font_path, showInterface=False) | |
| fonts.append(f) | |
| glyph_set_dict = {} | |
| for i, this_font in enumerate(fonts): | |
| for glyphName in this_font.glyphOrder: | |
| if glyphName not in glyph_set_dict.keys(): | |
| glyph_set_dict[glyphName] = [i] | |
| else: | |
| glyph_set_dict[glyphName].append(i) | |
| for key in glyph_set_dict.keys(): | |
| missing = [font_index for font_index in list(range(len(fonts))) if font_index not in glyph_set_dict[key]] | |
| for item in missing: | |
| print ('{0} is missing in {1} {2}'.format(str(key), fonts[item].info.familyName, fonts[item].info.styleName)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment