Skip to content

Commit efdef87

Browse files
authored
Merge pull request #190 from kumattau/reproducible-font-updating
PR: Preserves timestamp, bboxes, and table order for faithful to original and reproducible font updating
2 parents 8e44cbe + 0b4a454 commit efdef87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setupbase.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def rename_font(font_path, font_name):
2929
Font renaming code originally from:
3030
https://github.com/chrissimpkins/fontname.py/blob/master/fontname.py
3131
"""
32-
tt = ttLib.TTFont(font_path)
32+
tt = ttLib.TTFont(font_path, recalcBBoxes=False, recalcTimestamp=False)
3333
namerecord_list = tt["name"].names
3434
variant = ""
3535

@@ -68,7 +68,7 @@ def rename_font(font_path, font_name):
6868

6969
# write changes to the font file
7070
try:
71-
tt.save(font_path)
71+
tt.save(font_path, reorderTables=False)
7272
except:
7373
raise RuntimeError(
7474
f"ERROR: unable to write new name to OpenType tables for: {font_path}")

0 commit comments

Comments
 (0)