diff options
author | Rasmus Andersson <rasmus@notion.se> | 2017-11-29 04:11:48 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2017-11-29 04:11:48 +0300 |
commit | 1f684610cd33f3ca6aef0891bcd597669130b683 (patch) | |
tree | 17955cb034022e29293084eb02867d97c2114d41 /misc/check-font.py | |
parent | 12076e07b1daaef1653593e3c6dcc9e6baeee589 (diff) | |
download | inter-1f684610cd33f3ca6aef0891bcd597669130b683.tar.xz |
Adds script for verifying font files
Diffstat (limited to 'misc/check-font.py')
-rwxr-xr-x | misc/check-font.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/misc/check-font.py b/misc/check-font.py new file mode 100755 index 000000000..e7c432cad --- /dev/null +++ b/misc/check-font.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# encoding: utf8 +from __future__ import print_function +import os, sys +from argparse import ArgumentParser +from multiprocessing import Pool +import extractor, defcon + + +def check_font(filename): + print('check %s' % filename) + ufo = defcon.Font() + extractor.extractUFO(filename, ufo, doGlyphs=True, doInfo=True, doKerning=True) + + +def main(argv=None): + opts = ArgumentParser(description='Check') + + opts.add_argument( + 'fontFiles', metavar='<file>', type=str, nargs='+', + help='Font files (otf, ttf, woff, woff2, pfa, pfb, ttx)') + + args = opts.parse_args(argv) + + if len(args.fontFiles) == 1: + check_font(args.fontFiles[0]) + else: + p = Pool(8) + p.map(check_font, args.fontFiles) + p.terminate() + + +if __name__ == '__main__': + main() |