mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 20:48:41 +00:00
fix(fonts): fix the timestamp of fonts to the epoch (#3370)
* fix: fix the timestamp of fonts to the epoch * fix: update fonts Co-authored-by: Erik Demaine <edemaine@mit.edu>
This commit is contained in:
@@ -15,13 +15,12 @@ if len(sys.argv) < 2:
|
||||
font_file = sys.argv[1]
|
||||
font_name = os.path.splitext(os.path.basename(font_file))[0]
|
||||
|
||||
# now or SOURCE_DATE_EPOCH, if present
|
||||
timestamp = timestampNow()
|
||||
|
||||
font = TTFont(font_file, recalcBBoxes=False, recalcTimestamp=False)
|
||||
|
||||
font['head'].created = timestamp
|
||||
font['head'].modified = timestamp
|
||||
# fix timestamp to the epoch
|
||||
font['head'].created = 0
|
||||
font['head'].modified = 0
|
||||
|
||||
# remove fontforge timestamps
|
||||
if 'FFTM' in font:
|
||||
@@ -36,8 +35,6 @@ if 'GDEF' in font:
|
||||
font['name'].names = [record for record in font['name'].names if record.platformID != 1]
|
||||
font['cmap'].tables = [table for table in font['cmap'].tables if table.platformID != 1]
|
||||
|
||||
font['name'].setName('Version ' + str(timestamp), 5, 3, 1, 1033)
|
||||
|
||||
# fix OS/2 and hhea metrics
|
||||
glyf = font['glyf']
|
||||
ascent = int(max(glyf[c].yMax for c in font.getGlyphOrder() if hasattr(glyf[c], "yMax")))
|
||||
|
Reference in New Issue
Block a user