fontforge/propagate-creation-and-modification-times-to-ttf.patch
2015-05-01 15:49:29 +00:00

34 lines
1.4 KiB
Diff

From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774148
Description: propagate creation and modification times to TTF
Instead of using the current time as creation and modification
times when writing a TrueType Font file, we now propagate those
coming from the source. This enables TrueType Font to be built
reproducibly.
Index: fontforge-20150330/fontforge/tottf.c
===================================================================
--- fontforge-20150330.orig/fontforge/tottf.c
+++ fontforge-20150330/fontforge/tottf.c
@@ -2758,7 +2758,6 @@ void cvt_unix_to_1904( long long time, i
static void sethead(struct head *head,SplineFont *sf,struct alltabs *at,
enum fontformat format, int32 *bsizes) {
- time_t now;
int i, lr, rl, indic_rearrange, arabic;
ASM *sm;
struct ttflangname *useng;
@@ -2866,10 +2865,8 @@ static void sethead(struct head *head,Sp
head->flags |= (1<<9); /* Apple documents this */
/* if there are any indic characters, set bit 10 */
- time(&now); /* seconds since 1970, need to convert to seconds since 1904 */
- cvt_unix_to_1904(now,head->modtime);
- memcpy(head->createtime,head->modtime,sizeof(head->modtime));
-
+ cvt_unix_to_1904(sf->modificationtime,head->modtime);
+ cvt_unix_to_1904(sf->creationtime,head->createtime);
}
static void sethhead(struct hhead *hhead,struct hhead *vhead,struct alltabs *at, SplineFont *sf) {