forked from pool/fontforge
Petr Gajdos
779e0cfc3d
- added propagate-creation-and-modification-times-to-ttf.patch from debian's reproducible build project to get reproducible font builds OBS-URL: https://build.opensuse.org/request/show/284148 OBS-URL: https://build.opensuse.org/package/show/M17N/fontforge?expand=0&rev=41
34 lines
1.4 KiB
Diff
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.
|
|
|
|
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) {
|