-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
Makefile-fonts
162 lines (118 loc) · 6.1 KB
/
Makefile-fonts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
.PHONY: fonttooling
.sources: fonttooling
[ -h .sources ] || mkdir -p $@
.fonts: fonttooling
[ -h .fonts ] || mkdir -p $@
if FONT_DOWNLOAD_TOOLS
# Also defined as a dummy on other side of conditional
fonttooling:
$(if $(BSDTAR),,$(error Please set BSDTAR with path or `./configure --enable-developer-mode`))
$(if $(CURL),,$(error Please set CURL with path or `./configure --enable-developer-mode`))
# Don't let make delete things we had to download
.PRECIOUS: .fonts/% .sources/%
# List of font files we _actually need_
DEFSFONTFILES = GentiumPlus-R.ttf GentiumPlus-I.ttf
DOCSFONTFILES = $(DEFSFONTFILES)
DOCSFONTFILES += CormorantInfant-Italic.ttf CormorantInfant-Regular.ttf
DOCSFONTFILES += GenBkBasR.ttf GenBkBasI.ttf GenBkBasB.ttf
DOCSFONTFILES += Hack-Regular.ttf
DOCSFONTFILES += LateefGR-Regular.ttf
DOCSFONTFILES += LibertinusMath-Regular.otf
DOCSFONTFILES += LibertinusSerif-Regular.otf
DOCSFONTFILES += NotoSansCJK-Regular.ttc
DOCSFONTFILES += NotoSansEthiopic-Regular.ttf
DOCSFONTFILES += RobotoCondensed-Bold.ttf
DOCSFONTFILES += Symbola.otf
TESTFONTFILES = $(DOCSFONTFILES)
TESTFONTFILES += Amiri-Regular.ttf
TESTFONTFILES += AmiriQuran.ttf
TESTFONTFILES += AwamiNastaliq-Regular.ttf
TESTFONTFILES += FRBTaiwaneseKana.otf
TESTFONTFILES += LibertinusSans-Bold.otf
TESTFONTFILES += NotoNaskhArabic-Regular.ttf
TESTFONTFILES += NotoSansKannada-Regular.ttf
TESTFONTFILES += NotoSansMalayalam-Regular.ttf
TESTFONTFILES += NotoSerifCJK-Regular.ttc
TESTFONTFILES += SBL_Hbrw.ttf
TESTFONTFILES += TwemojiMozilla.ttf
if FONT_VARIATIONS
TESTFONTFILES += Tourney[wdth,wght].ttf
endif
comma = ,
varencode = $(subst $(comma),%2C,$(subst [,%5B,$(subst ],%5D,$(1))))
notobase = $(shell echo $(notdir $1) | sed -e 's/-.*//')
# Tell make how to download individual font files directly (when available)
.fonts/Amiri%: | .fonts
$(CURL) -fsSL https://github.com/alif-type/amiri/raw/0.113/$(notdir $@) -o $@
.fonts/Noto%.ttf: | .fonts
$(CURL) -fsSL https://raw.githubusercontent.com/googlefonts/noto-fonts/v20201206-phase3/hinted/ttf/$(call notobase,$@)/$(notdir $@) -o $@
.fonts/Noto%.ttc: | .fonts
$(CURL) -fsSL https://raw.githubusercontent.com/googlefonts/noto-cjk/v20201206-cjk/$(notdir $@) -o $@
.fonts/SBL_Hbrw.ttf: | .fonts
$(CURL) -fsSL https://www.sbl-site.org/Fonts/$(notdir $@) -o $@
.fonts/Symbola.otf: | .fonts
$(CURL) -fsSL https://github.com/ChiefMikeK/ttf-symbola/raw/master/Symbola-13.otf -o $@
.fonts/Tourney%: | .fonts
$(CURL) -fsSL https://raw.githubusercontent.com/Etcetera-Type-Co/Tourney/643f1026ad6d41b4527f42cd93c776414fdd6503/fonts/variable/$(call varencode,$(notdir $@)) -o $@
.fonts/TwemojiMozilla.ttf: | .fonts
$(CURL) -fsSL https://github.com/mozilla/twemoji-colr/releases/download/v0.5.1/$(notdir $@) -o $@
.fonts/FRBTaiwaneseKana.otf: | .fonts
: $(CURL) -fsSL https://github.com/ctrlcctrlv/FRBTaiwaneseKana/releases/download/v1.1/$(notdir $@) -o $@
$(CURL) -fsSL https://raw.githubusercontent.com/ctrlcctrlv/FRBTaiwaneseKana/5c367e9ee5aefd54b5c9c9e996705f0561fe3d15/$(notdir $@) -o $@
# Tell make how to download font file bundles (when not downloadable individually)
.sources/AwamiNastaliq-2.200.zip: | .sources
$(CURL) -fsSL https://software.sil.org/downloads/r/awami/$(notdir $@) -o $@
.sources/CrimsonPro.zip: | .sources
$(CURL) -fsSL https://fonts.google.com/download?family=Crimson+Pro -o $@
.sources/Cormorant_Install_v3.601.zip: | .sources
$(CURL) -fsSL https://github.com/CatharsisFonts/Cormorant/releases/download/v3.601/$(notdir $@) -o $@
.sources/GentiumBasic_1102.zip: | .sources
$(CURL) -fsSL https://software.sil.org/downloads/r/gentium/$(notdir $@) -o $@
.sources/GentiumPlus-5.000.zip: | .sources
$(CURL) -fsSL https://software.sil.org/downloads/r/gentium/$(notdir $@) -o $@
.sources/Hack-v3.003-ttf.tar.xz: | .sources
$(CURL) -fsSL https://github.com/source-foundry/Hack/releases/download/v3.003/$(notdir $@) -o $@
.sources/LateefGR-1.200.zip: | .sources
$(CURL) -fsSL https://software.sil.org/downloads/r/lateef/$(notdir $@) -o $@
.sources/Libertinus-%.tar.zst: | .sources
$(CURL) -fsSL https://github.com/alerque/libertinus/releases/download/v$*/$(notdir $@) -o $@
.sources/roboto-unhinted.zip: | .sources
$(CURL) -fsSL https://github.com/google/roboto/releases/download/v2.138/$(notdir $@) -o $@
.sources/Symbola.zip: | .sources
$(CURL) -fsSL https://web.archive.org/web/20200617144517/https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/$(notdir $@) -o $@
# Canonical upstream server limits downloads which sometimes kills our CI runners
# $(CURL) -fsSL https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/$(notdir $@) -o $@
# Tell make how to extract individual files from bundles
.fonts/AwamiNastaliq%: .sources/AwamiNastaliq-2.200.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@) && \
touch $@
.fonts/Cormorant%: .sources/Cormorant_Install_v3.601.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 2 "$(basename $(<F))/1. TrueType Font Files/$(notdir $@)" && \
touch $@
.fonts/CrimsonPro%: .sources/CrimsonPro.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 1 static/$(notdir $@) && \
touch $@
.fonts/GenB%: .sources/GentiumBasic_1102.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@) && \
touch $@
.fonts/GentiumPlus%: .sources/GentiumPlus-5.000.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@) && \
touch $@
.fonts/Hack%: .sources/Hack-v3.003-ttf.tar.xz | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) $(notdir $@) && \
touch $@
.fonts/Libertinus%: .sources/Libertinus-7.050.tar.zst | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 3 $(basename $(basename $(<F)))/static/OTF/$(notdir $@) && \
touch $@
.fonts/LateefGR%: .sources/LateefGR-1.200.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@) && \
touch $@
.fonts/Roboto%: .sources/roboto-unhinted.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) $(notdir $@) && \
touch $@
.fonts/Symbola%: .sources/Symbola.zip | .fonts
$(BSDTAR) -x -f $< -C $(dir $@) $(notdir $@) && \
touch $@
else !FONT_DOWNLOAD_TOOLS
fonttooling: ;
endif