-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathcheckUFOProcessedLayer.py
More file actions
40 lines (28 loc) · 923 Bytes
/
checkUFOProcessedLayer.py
File metadata and controls
40 lines (28 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright 2014 Adobe. All rights reserved.
"""
For a UFO font, check that the glyph hashes stored when checkOutlines or
autohint were last run still match the source glyph hashes.
If not, all outdated glyphs are deleted from the Adobe processed layer.
"""
__usage__ = """
checkUFOProcessedLayer v1.0 July 17 2013
checkUFOProcessedLayer [-checkOnly] <ufo font path>
Options:
-checkOnly When this option is specified, the tool will report
which glyphs in the processed layer are outdated, but will not
delete them.
"""
import sys
from afdko import ufoTools
kSrcGLIFHashMap = "com.adobe.type.autoHintHashMap"
def run():
fontPath = sys.argv[1]
doSync = True
allMatch, msgList = ufoTools.checkHashMaps(fontPath, doSync)
if allMatch:
print("All processed glyphs match")
else:
for msg in msgList:
print(msg)
if __name__ == "__main__":
run()