From 0b4a4543f950f3ba9c2cb1f45b71cd1f5a64da04 Mon Sep 17 00:00:00 2001 From: kumattau Date: Thu, 9 Dec 2021 00:14:34 +0900 Subject: [PATCH] Preserves timestamp, bboxes, and table order for faithful to original and reproducible font updating --- setupbase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setupbase.py b/setupbase.py index 9aee99a3..08fe165c 100644 --- a/setupbase.py +++ b/setupbase.py @@ -29,7 +29,7 @@ def rename_font(font_path, font_name): Font renaming code originally from: https://github.com/chrissimpkins/fontname.py/blob/master/fontname.py """ - tt = ttLib.TTFont(font_path) + tt = ttLib.TTFont(font_path, recalcBBoxes=False, recalcTimestamp=False) namerecord_list = tt["name"].names variant = "" @@ -68,7 +68,7 @@ def rename_font(font_path, font_name): # write changes to the font file try: - tt.save(font_path) + tt.save(font_path, reorderTables=False) except: raise RuntimeError( f"ERROR: unable to write new name to OpenType tables for: {font_path}")