[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-fonts-devel] Bug#774148: fontforge: please propagate creation and modification times to generated ttf files



Package: fontforge
Version: 1:2.0.20140101-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain timestamps

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that packages using fontforge to generate TrueType fonts could not
be build reproducibly.

fontforge currently writes the current time as creation time and
modification time when generating TrueType fonts. With the attached
patch these fields will be populated with the data read from the source
file, enabling TrueType fonts to be build reproducibly.

 [1]: https://wiki.debian.org/ReproducibleBuilds

-- 
Lunar                                .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
From e97db74ba8765613a35572d7a7e96f1b0b5b20ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar@debian.org>
Date: Mon, 29 Dec 2014 11:07:52 +0000
Subject: [PATCH] Add a patch to propagate creation and modification times to
 TTF files

This enable TrueType Font to be built reproducibly.
---
 ...te-creation-and-modification-times-to-ttf.patch | 31 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 debian/patches/propagate-creation-and-modification-times-to-ttf.patch

diff --git a/debian/patches/propagate-creation-and-modification-times-to-ttf.patch b/debian/patches/propagate-creation-and-modification-times-to-ttf.patch
new file mode 100644
index 0000000..0eb7f52
--- /dev/null
+++ b/debian/patches/propagate-creation-and-modification-times-to-ttf.patch
@@ -0,0 +1,31 @@
+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) {
diff --git a/debian/patches/series b/debian/patches/series
index 6a8916c..f540e01 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
 gitignore
 set_fontforge_package_name.patch
 fix-spelling-error.patch
+propagate-creation-and-modification-times-to-ttf.patch
-- 
2.1.3

Attachment: signature.asc
Description: Digital signature


Reply to: