File propagate-creation-and-modification-times-to-ttf.patch of Package fontforge

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.

diff --git a/fontforge/tottf.c b/fontforge/tottf.c
index a980610..3d488b0 100644
--- a/fontforge/tottf.c
+++ b/fontforge/tottf.c
@@ -2812,7 +2812,6 @@ void cvt_unix_to_1904( long time, int32 result[2]) {
 
 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;
@@ -2920,10 +2919,8 @@ static void sethead(struct head *head,SplineFont *sf,struct alltabs *at,
 	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) {
openSUSE Build Service is sponsored by