generate-original-source: Remove FFTM table

[why]
When the CI triggers a rebuild of the original-source and the font
contents is unchanged we do not want to commit the new version back to
the repo.

But because fontforge puts the creation date into the font file it will
always differ on every run, and we would needlessly create commits.

[how]
We could use the SOURCE_DATE_EPOCH approach and set the dates to the
relevant change (commit) times like so:

cd src/svgs
export SOURCE_DATE_EPOCH="$(git log -1 --format=%ct -- *.svg)"

and only afterwards call the generator script / fontforge.

But that would need a complete git repo checkout and not just a shallow
one (which is faster and thus is used by github action/checkout).

Instead we can instruct fontforge to not put any timestamp into the
file. The timestamps are anyhow a fontforge proprietary extension.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-09-20 10:13:05 +02:00
parent 73ae4a96b4
commit cc2b547703

View file

@ -161,7 +161,7 @@ for codepoint, data in icon_datasets.items():
num_icons = len(icon_datasets)
print('Generating {} with {} glyphs'.format(fontfile, num_icons))
font.generate(os.path.join(fontdir, fontfile))
font.generate(os.path.join(fontdir, fontfile), flags=("no-FFTM-table",))
# We create the font, but ... patch it in on other codepoints :-}
icon_datasets = { code + codepoint_shift : data for (code, data) in icon_datasets.items() }