MCPcopy
hub / github.com/rsms/inter / main

Function main

misc/tools/glyphcheck.py:7–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def main():
8 argparser = argparse.ArgumentParser(description='Check glyph names')
9
10 argparser.add_argument('fontfiles', metavar='<path>', type=str, nargs='+',
11 help='TrueType or OpenType font files')
12
13 args = argparser.parse_args()
14
15 nmissing = 0
16
17 matchnames = set()
18 for line in sys.stdin:
19 line = line.strip()
20 if len(line) > 0 and line[0] != '#':
21 for line2 in line.split():
22 line2 = line2.strip()
23 if len(line2) > 0:
24 matchnames.add(line2)
25
26 for fontfile in args.fontfiles:
27 font = ttLib.TTFont(fontfile)
28 glyphnames = set(font.getGlyphOrder())
29
30 # for name in glyphnames:
31 # if not name in matchnames:
32 # print('%s missing in input' % name)
33
34 for name in matchnames:
35 if not name in glyphnames:
36 print('%s missing in font' % name)
37 nmissing = nmissing + 1
38
39
40 if nmissing == 0:
41 print('all glyphs found')
42
43
44if __name__ == '__main__':

Callers 1

glyphcheck.pyFile · 0.70

Calls 1

addMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…