-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile-fonts
176 lines (135 loc) · 6.5 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
.fonts: fontconfig.conf
[ -h .fonts ] || mkdir -p $@
.sources:
[ -h .sources ] || mkdir -p $@
# 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
DEFSFONTFILES += Hack-Regular.ttf
DEFSFONTFILES += LibertinusSerif-Regular.otf
DEFSFONTFILES += LibertinusMath-Regular.otf
EXAMFONTFILES = $(DEFSFONTFILES)
EXAMFONTFILES += AcornInitials.ttf
EXAMFONTFILES += Amiri-Regular.ttf
EXAMFONTFILES += Cardo104s.ttf
EXAMFONTFILES += DejaVuSansCondensed-Bold.ttf DejaVuSans-Bold.ttf DejaVuSans-Oblique.ttf
EXAMFONTFILES += EBGaramond-Regular.ttf
EXAMFONTFILES += Estonia-Regular.ttf
EXAMFONTFILES += Jomolhari-alpha3c-0605331.ttf
EXAMFONTFILES += Junicode-Regular.ttf
EXAMFONTFILES += LateefGR-Regular.ttf
EXAMFONTFILES += LibertinusSerif-Bold.otf
EXAMFONTFILES += NotoSans-Regular.ttf
EXAMFONTFILES += NotoSansArabic-Regular.ttf
EXAMFONTFILES += NotoSansArmenian-Regular.ttf
EXAMFONTFILES += NotoSansBengali-Regular.ttf
EXAMFONTFILES += NotoSansCJK-Regular.ttc
EXAMFONTFILES += NotoSansCanadianAboriginal-Regular.ttf
EXAMFONTFILES += NotoSansDevanagari-Regular.ttf
EXAMFONTFILES += NotoSansGeorgian-Regular.ttf
EXAMFONTFILES += NotoSansHebrew-Regular.ttf
EXAMFONTFILES += NotoSansKhmer-Regular.ttf
EXAMFONTFILES += NotoSansMalayalam-Regular.ttf
EXAMFONTFILES += NotoSansMyanmar-Regular.ttf
EXAMFONTFILES += NotoSansSinhala-Regular.ttf
EXAMFONTFILES += NotoSansTamil-Regular.ttf
EXAMFONTFILES += NotoSansThai-Regular.ttf
EXAMFONTFILES += NotoSerif-Regular.ttf
EXAMFONTFILES += NotoSerifArmenian-Regular.ttf
EXAMFONTFILES += NotoSerifCJK-Regular.ttc
EXAMFONTFILES += Padauk-Regular.ttf
EXAMFONTFILES += TuladhaJejegOT-Regular.otf
EXAMFONTFILES += ZallmanCaps.ttf
EXAMFONTFILES += mnglwhiteotf.ttf
EXAMFONTFILES += newathu5_5.ttf
notobase = $(shell sed -e 's/-.*//' <<< $(notdir $1))
# 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/mngl%.ttf: | .fonts
curl -fsSL http://mongolfont.com/jAlmas/cms/documents/mongolfont/font/$(notdir $@) -o $@
.fonts/Noto%.ttf: | .fonts
curl -fsSL https://github.com/googlefonts/noto-fonts/raw/v20201206-phase3/hinted/ttf/$(call notobase,$@)/$(notdir $@) -o $@
.fonts/Noto%.ttc: | .fonts
curl -fsSL https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/$(notdir $@) -o $@
.fonts/EBGaramond-Regular.ttf: | .fonts
curl -fsSL https://fonts.googleapis.com/css?family=EB%20Garamond:400 |
sed -ne '/src:/{s/.*url(//;s/).*//;p}' |
xargs curl -fsSL -o $@
touch $@
.fonts/Estonia-Regular.ttf: | .fonts
curl -fsSL https://fonts.googleapis.com/css?family=Estonia:400 |
sed -ne '/src:/{s/.*url(//;s/).*//;p}' |
xargs curl -fsSL -o $@
touch $@
# Tell make how to download font file bundles (when not downloadable individually)
.sources/acorn-initials.zip: | .sources
curl -fsSL https://www.1001fonts.com/download/$(notdir $@) -o $@
.sources/cardo104.zip: | .sources
curl -fsSL https://scholarsfonts.net/$(notdir $@) -o $@
.sources/dejavu-fonts-ttf-2.37.tar.bz2: | .sources
curl -fsSL https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/$(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/Jomolhari-alpha003.zip: | .sources
curl -fsSL https://collab.its.virginia.edu/access/content/group/26a34146-33a6-48ce-001e-f16ce7908a6a/Tibetan%20fonts/Tibetan%20Unicode%20Fonts/$(notdir $@) -o $@
.sources/Junicode_2.209.zip: | .sources
curl -fsSL https://github.com/psb1558/Junicode-font/releases/download/v2.209/$(notdir $@) -o $@
.sources/LateefGR-1.200.zip: | .sources
curl -fsSL https://software.sil.org/downloads/r/lateef/$(notdir $@) -o $@
.sources/Libertinus-%.tar.xz: | .sources
curl -fsSL https://github.com/alerque/libertinus/releases/download/v$*/$(notdir $@) -o $@
.sources/NAU5_005.zip: | .sources
curl -fsSL https://classicalstudies.org/sites/default/files/userfiles/files/$(notdir $@) -o $@
.sources/Padauk-5.000.zip: | .sources
curl -fsSL https://software.sil.org/downloads/r/padauk/$(notdir $@) -o $@
.sources/Tuladha-Jejeg-OT-%.zip: | .sources
curl -fsSL https://github.com/akufadhl/Tuladha-Jejeg-OT/releases/download/v$*/$(notdir $@) -o $@
.sources/zallman-caps.zip: | .sources
curl -fsSL https://www.1001fonts.com/download/$(notdir $@) -o $@
# Tell make how to extract individual files from bundles
.fonts/AcornInitials.ttf: .sources/acorn-initials.zip | .fonts
bsdtar -x -f $< -C $(dir $@) $(notdir $@)
touch $@
.fonts/Cardo%: .sources/cardo104.zip | .fonts
bsdtar -x -f $< -C $(dir $@) $(notdir $@)
touch $@
.fonts/DejaVu%: .sources/dejavu-fonts-ttf-2.37.tar.bz2 | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 2 $(basename $(basename $(<F)))/ttf/$(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/Jomolhari-alpha3c-0605331.ttf: .sources/Jomolhari-alpha003.zip | .fonts
bsdtar -x -f $< -C $(dir $@) $(notdir $@)
touch $@
.fonts/Junicode%: .sources/Junicode_2.209.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 2 Junicode/TTF/$(notdir $@)
touch $@
.fonts/LateefGR%: .sources/LateefGR-1.200.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@)
touch $@
.fonts/Libertinus%: .sources/Libertinus-7.020.tar.xz | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 3 $(basename $(basename $(<F)))/static/OTF/$(notdir $@)
touch $@
.fonts/newathu5_5.ttf: .sources/NAU5_005.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@)
touch $@
.fonts/Padauk%: .sources/Padauk-5.000.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@)
touch $@
.fonts/ScheherazadeNew%: .sources/ScheherazadeNew-3.200.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@)
touch $@
.fonts/Tuladha%: .sources/Tuladha-Jejeg-OT-0.05.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 2 fonts/otf/$(notdir $@)
touch $@
.fonts/ZallmanCaps.ttf: .sources/zallman-caps.zip | .fonts
bsdtar -x -f $< -C $(dir $@) $(notdir $@)
touch $@