forked from sile-typesetter/sile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile-fonts
133 lines (98 loc) · 4.96 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
.fonts:
[ -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
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 += 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
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/TwemojiMozilla.ttf: | .fonts
curl -fsSL https://github.com/mozilla/twemoji-colr/releases/download/v0.5.1/$(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.xz: | .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.020.tar.xz | .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 $@