diff options
author | Peter Colberg <peter@colberg.org> | 2015-10-29 19:48:49 -0400 |
---|---|---|
committer | Peter Colberg <peter@colberg.org> | 2015-10-29 19:48:49 -0400 |
commit | f35e18e4b5300226891e4288d9dba6fc0f737851 (patch) | |
tree | c2871f26987e24cd767f503d113f8ceff78882bc /data/Makefile | |
parent | 9b7184ec56c49fd69082280d230bb85a3e486427 (diff) | |
download | libutf8proc-f35e18e4b5300226891e4288d9dba6fc0f737851.tar.gz libutf8proc-f35e18e4b5300226891e4288d9dba6fc0f737851.tar.bz2 |
Generate fontforge font files in makefile
Revise the script to directly read fontforge font files, which are
generated in the makefile. This permits overriding the fontforge path
during the build, and executing fontforge in parallel with make -j.
Avoid duplicating download URLs in the script, which ensures that the
script itself works without network access, e.g., when downloading the
data files on a developer machine with network access and executing the
script on a build machine without network access.
Diffstat (limited to 'data/Makefile')
-rw-r--r-- | data/Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/data/Makefile b/data/Makefile index ebe67ae..31e3934 100644 --- a/data/Makefile +++ b/data/Makefile @@ -9,6 +9,7 @@ RUBY=ruby PERL=perl MAKE=make JULIA=julia +FONTFORGE=fontforge CURLFLAGS = --retry 5 --location # use JuliaLang caching (https://github.com/staticfloat/cache.julialang.org) @@ -25,14 +26,17 @@ utf8proc_data.c.new: data_generator.rb UnicodeData.txt GraphemeBreakProperty.txt # GNU Unifont version for font metric calculations: UNIFONT_VERSION=8.0.01 -unifont-$(UNIFONT_VERSION).ttf: +unifont.ttf: $(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)http://unifoundry.com/pub/unifont-$(UNIFONT_VERSION)/font-builds/unifont-$(UNIFONT_VERSION).ttf -unifont_upper-$(UNIFONT_VERSION).ttf: +unifont_upper.ttf: $(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)http://unifoundry.com/pub/unifont-$(UNIFONT_VERSION)/font-builds/unifont_upper-$(UNIFONT_VERSION).ttf -CharWidths.txt: charwidths.jl unifont-$(UNIFONT_VERSION).ttf unifont_upper-$(UNIFONT_VERSION).ttf EastAsianWidth.txt - UNIFONT_VERSION=$(UNIFONT_VERSION) $(JULIA) charwidths.jl > $@ +%.sfd: %.ttf + $(FONTFORGE) -lang=ff -c "Open(\"$<\");Save(\"$@\");Quit(0);" + +CharWidths.txt: charwidths.jl unifont.sfd unifont_upper.sfd EastAsianWidth.txt + $(JULIA) charwidths.jl > $@ UnicodeData.txt: $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/UnicodeData.txt |