diff options
author | Steven G. Johnson <stevenj@mit.edu> | 2015-03-08 17:23:43 -0400 |
---|---|---|
committer | Steven G. Johnson <stevenj@mit.edu> | 2015-03-12 12:10:19 -0400 |
commit | a4c84d2063bb6f2218bc20f89e59001319361f6d (patch) | |
tree | bf9799783e0f66c67f0303ea13a778fe51eff539 /data/Makefile | |
parent | 08f101a9e8c6a72dfdb1c9b913df880e13a36333 (diff) | |
download | libutf8proc-a4c84d2063bb6f2218bc20f89e59001319361f6d.tar.gz libutf8proc-a4c84d2063bb6f2218bc20f89e59001319361f6d.tar.bz2 |
fix #2: add charwidth function
Diffstat (limited to 'data/Makefile')
-rw-r--r-- | data/Makefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/data/Makefile b/data/Makefile new file mode 100644 index 0000000..409e03a --- /dev/null +++ b/data/Makefile @@ -0,0 +1,62 @@ +# Unicode data generation rules. Except for the test data files, most +# users will not use these Makefile rules, which are primarily to re-generate +# unicode_data.c when we get a new Unicode version or charwidth data; they +# require ruby, fontforge, and julia to be installed. + +# programs +CURL=curl +RUBY=ruby +PERL=perl +MAKE=make +JULIA=julia +CURLFLAGS = --retry 5 --location + +# use JuliaLang caching (https://github.com/staticfloat/cache.julialang.org) +# so that Travis builds do not depend on anyone's flaky servers but our own +URLCACHE=https://cache.e.ip.saba.us/ + +.PHONY: clean + +.DELETE_ON_ERROR: + +utf8proc_data.c.new: data_generator.rb UnicodeData.txt GraphemeBreakProperty.txt DerivedCoreProperties.txt CompositionExclusions.txt CaseFolding.txt CharWidths.txt + $(RUBY) data_generator.rb < UnicodeData.txt > $@ + +# GNU Unifont version for font-metric calculations: +UNIFONT_VERSION=7.0.06 + +unifont-$(UNIFONT_VERSION).ttf: + $(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)http://unifoundry.com/pub/unifont-$(UNIFONT_VERSION)/font-builds/unifont-$(UNIFONT_VERSION).ttf + +unifont_upper-$(UNIFONT_VERSION).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 > $@ + +UnicodeData.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/UnicodeData.txt + +EastAsianWidth.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt + +GraphemeBreakProperty.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt + +DerivedCoreProperties.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt + +CompositionExclusions.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt + +CaseFolding.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/CaseFolding.txt + +NormalizationTest.txt: + $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt + +GraphemeBreakTest.txt: + $(CURL) $(CURLFLAGS) $(URLCACHE)http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt | $(PERL) -pe 's,÷,/,g;s,×,+,g' > $@ + +clean: + rm -f UnicodeData.txt EastAsianWidth.txt DerivedCoreProperties.txt CompositionExclusions.txt CaseFolding.txt NormalizationTest.txt GraphemeBreakTest.txt CharWidths.txt unifont*.ttf unifont*.sfd |