diff options
author | Rasmus Andersson <rasmus@notion.se> | 2017-08-31 18:16:38 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2017-08-31 18:16:38 +0300 |
commit | 7e52b008d08bf11817b12c0495d8ef0d75d72185 (patch) | |
tree | 7ddb7a989e9989189fbeace8f0128f073fc2f511 /misc/gen-glyphorder.py | |
parent | da49fd5536db3762d17b1fc176fca8885b10dd92 (diff) | |
download | inter-7e52b008d08bf11817b12c0495d8ef0d75d72185.tar.xz |
Improves glyphorder generation
Diffstat (limited to 'misc/gen-glyphorder.py')
-rwxr-xr-x | misc/gen-glyphorder.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/misc/gen-glyphorder.py b/misc/gen-glyphorder.py index 3161f4a12..9707b807b 100755 --- a/misc/gen-glyphorder.py +++ b/misc/gen-glyphorder.py @@ -37,27 +37,33 @@ def main(): argparser.add_argument('fontPaths', metavar='<ufofile>', type=str, nargs='+', help='UFO files') args = argparser.parse_args() - glyphorderUnion = OrderedDict() + srcdir = os.path.abspath(os.path.join(__file__, '..', '..')) + nameLists = [] fontPaths = [] + for fontPath in args.fontPaths: if 'regular' or 'Regular' in fontPath: fontPaths = [fontPath] + fontPaths else: fontPaths.append(fontPath) - nameLists = [] - for fontPath in fontPaths: libPlist = plistlib.readPlist(os.path.join(fontPath, 'lib.plist')) - names = [] if 'public.glyphOrder' in libPlist: nameLists.append(libPlist['public.glyphOrder']) + glyphorderUnion = OrderedDict() + for names in zip(*nameLists): for name in names: glyphorderUnion[name] = True + # add any composed glyphs to the end + diacriticComps = loadGlyphCompositions(os.path.join(srcdir, 'src', 'diacritics.txt')) + for name in diacriticComps.keys(): + glyphorderUnion[name] = True + glyphorderUnionNames = glyphorderUnion.keys() print('\n'.join(glyphorderUnionNames)) |