New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please make .OTF generation reproducible. #219
Conversation
a9d3fd4
to
81c1223
Compare
|
Python 2 failing.. can't recall the incantation there! :) |
|
I don't think there's a one-line way to do this in Python 2. Easiest way may be to implement timezone.utc locally, as in the example here: https://docs.python.org/2/library/datetime.html#tzinfo-objects (under "Example tzinfo classes:"). |
Whilst working on the Reproducible Builds effort [0], we noticed that ufo2ft generates .otf files that are not reproducible. For example, here is showotf output of the league-spartan fonts: │ │ │ │ │ HEAD table (at 188) │ │ │ │ │ Version=1 │ │ │ │ │ fontRevision=2 │ │ │ │ │ - checksumAdj=e32dbbe4 │ │ │ │ │ + checksumAdj=e3309724 │ │ │ │ │ magicNumber=5f0f3cf5 (0x5f0f3cf5, diff=0) │ │ │ │ │ flags=3 baseline_at_0 lsb_at_0 │ │ │ │ │ unitsPerEm=1250 │ │ │ │ │ create[0]=0 │ │ │ │ │ - create[1]=d580d7b0 │ │ │ │ │ - File created: Tue Jul 4 05:27:12 2017 │ │ │ │ │ + create[1]=d57f6a10 │ │ │ │ │ + File created: Mon Jul 3 03:27:12 2017 … which shows that it varies on the local timezone. Patch attached. This has also been filed in Debian [1]. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/890280
81c1223
to
85711ed
Compare
|
@jamesgk Thanks for that. I have updated the PR to match and now I read:
:) |
|
@anthrotype and/or @moyogo, want to review before merging? And maybe we should add a unit test. |
|
Thanks! |
timestamp Follow up from googlefonts#219
|
Thanks @lamby for this PR! (hi @jamesgk! Yeah, this is a problem with the UFO spec, which doesn't make it clear whether dates and times should be interpreted as UTC or local time: Both you and I would interpret such "naive" UFO datetimes (without explicit timezone info) as UTC, however the author of ufo2fdk (from which ufo2ft was forked) seems to have interpreted them as local times. I only infer this from the fact that the code is using With your patch, you made this datetime object "aware" by giving it an explicit UTC But if we agree that all dates and times in UFO (lacking an explicit +HHMM offset) should be understood as UTC, I think an even simpler solution is to avoid using I'll send a PR for that. |
Whilst working on the Reproducible Builds effort, we noticed that ufo2ft generates
.otffiles that are not reproducible.For example, here is
showotfoutput of theleague-spartanfont:… which shows that it varies on the local timezone.
This has also been filed in Debian as #890280