Fix problem with repatching original file instead of patched file.
Uses the already-patched file, and prints a message to that effect.
@@ -354,6 +354,7 @@ def subset_symbols(srcdir, dstdir):
dstdir, path.basename(font_file)[:-4] + '-Subsetted2.ttf')
subset.subset_font(font_file, out_file, include=target_coverage)
+
def patch_post_table(srcdir, dstdir):
"""Replace post table version 2.0 with version 3.0"""
@@ -361,10 +362,14 @@ def patch_post_table(srcdir, dstdir):
for font_file in glob.glob(path.join(srcdir, '*.ttf')):
print 'change post table to 3.0', font_file
out_file = path.join(dstdir, path.basename(font_file))
+ if path.isfile(out_file):
+ print ' repatching', out_file
+ font_file = out_file
font = ttLib.TTFont(font_file)
font['post'].formatType = 3.0
font.save(out_file)
+
def patch_fonts(srcdir, dstdir):
"""Remove dstdir and repopulate with patched contents of srcdir (and
its 'cjk' subdirectory if it exists)."""
