forked from OmarIthawi/amiri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
155 lines (133 loc) · 5.29 KB
/
Makefile
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
.PHONY: all clean ttf web pack check
NAME=Amiri
LATIN=AmiriLatin
VERSION=0.112
TOOLS=tools
SRC=sources
WEB=webfonts
DOC=documentation
TESTS=test-suite
FONTS=$(NAME)-Regular $(NAME)-Bold $(NAME)-Slanted $(NAME)-BoldSlanted $(NAME)Quran $(NAME)QuranColored
DIST=$(NAME)-$(VERSION)
WDIST=$(NAME)-$(VERSION)-WebFonts
CDIST=$(NAME)-$(VERSION)-CTAN
BUILD=$(TOOLS)/build.py
RUNTEST=$(TOOLS)/runtest.py
MAKECLR=$(TOOLS)/makeclr.py
MAKECSS=$(TOOLS)/makecss.py
MAKEWEB=$(TOOLS)/makeweb.py
PY ?= python
FF=$(PY) $(BUILD)
PP=gpp -I$(SRC)
SFDS=$(FONTS:%=$(SRC)/%.sfdir)
DTTF=$(FONTS:%=%.ttf)
DOTF=$(FONTS:%=%.otf)
WOFF=$(FONTS:%=$(WEB)/%.woff)
WOF2=$(FONTS:%=$(WEB)/%.woff2)
CSSS=$(WEB)/$(NAME).css
PDFS=$(DOC)/FontTable-$(NAME).pdf $(DOC)/FontTable-$(NAME)Quran.pdf $(DOC)/Documentation-Arabic.pdf
FEAT=$(wildcard $(SRC)/*.fea)
TEST=$(wildcard $(TESTS)/*.test)
TEST+=$(wildcard $(TESTS)/*.ptest)
all: ttf web
ttf: $(DTTF)
otf: $(DOTF)
web: $(WOFF) $(WOF2) $(CSSS)
doc: $(PDFS)
$(NAME)Quran.ttf $(NAME)Quran.otf: $(SRC)/$(NAME)-Regular.sfdir $(SRC)/latin/$(LATIN)-Regular.sfdir $(SRC)/$(NAME).fea $(FEAT) $(BUILD)
@echo " FF $@"
@$(PP) -DQURAN $(SRC)/$(NAME).fea -o $(SRC)/$(NAME)Quran.fea.pp
@$(FF) --input $< --output $@ --features=$(SRC)/$(NAME)Quran.fea.pp --version $(VERSION) --quran
$(NAME)QuranColored.ttf: $(NAME)Quran.ttf $(MAKECLR)
@echo " FF $@"
@$(PY) $(MAKECLR) $< $@
$(NAME)QuranColored.otf: $(NAME)Quran.otf $(MAKECLR)
@echo " FF $@"
@$(PY) $(MAKECLR) $< $@
$(NAME)-Regular.ttf $(NAME)-Regular.otf: $(SRC)/$(NAME)-Regular.sfdir $(SRC)/latin/$(LATIN)-Regular.sfdir $(SRC)/$(NAME).fea $(FEAT) $(BUILD)
@echo " FF $@"
@$(PP) $(SRC)/$(NAME).fea -o $(SRC)/$(NAME)-Regular.fea.pp
@$(FF) --input $< --output $@ --features=$(SRC)/$(NAME)-Regular.fea.pp --version $(VERSION)
$(NAME)-Slanted.ttf $(NAME)-Slanted.otf: $(SRC)/$(NAME)-Regular.sfdir $(SRC)/latin/$(LATIN)-Italic.sfdir $(SRC)/$(NAME).fea $(FEAT) $(BUILD)
@echo " FF $@"
@$(PP) -DITALIC $(SRC)/$(NAME).fea -o $(SRC)/$(NAME)-Slanted.fea.pp
@$(FF) --input $< --output $@ --features=$(SRC)/$(NAME)-Slanted.fea.pp --version $(VERSION) --slant=10
$(NAME)-Bold.ttf $(NAME)-Bold.otf: $(SRC)/$(NAME)-Bold.sfdir $(SRC)/latin/$(LATIN)-Bold.sfdir $(SRC)/$(NAME).fea $(FEAT) $(BUILD)
@echo " FF $@"
@$(PP) $(SRC)/$(NAME).fea -o $(SRC)/$(NAME)-Bold.fea.pp
@$(FF) --input $< --output $@ --features=$(SRC)/$(NAME)-Bold.fea.pp --version $(VERSION)
$(NAME)-BoldSlanted.ttf $(NAME)-BoldSlanted.otf: $(SRC)/$(NAME)-Bold.sfdir $(SRC)/latin/$(LATIN)-BoldItalic.sfdir $(SRC)/$(NAME).fea $(FEAT) $(BUILD)
@echo " FF $@"
@$(PP) -DITALIC $(SRC)/$(NAME).fea -o $(SRC)/$(NAME)-BoldSlanted.fea.pp
@$(FF) --input $< --output $@ --features=$(SRC)/$(NAME)-BoldSlanted.fea.pp --version $(VERSION) --slant=10
$(WEB)/%.woff $(WEB)/%.woff2: %.ttf $(MAKEWEB)
@echo " WEB $*"
@mkdir -p $(WEB)
@$(PY) $(MAKEWEB) $< $(WEB)
$(WEB)/%.css: $(WOFF) $(MAKECSS)
@echo " GEN $@"
@mkdir -p $(WEB)
@$(PY) $(MAKECSS) --css=$@ --fonts="$(WOFF)"
$(DOC)/FontTable-$(NAME)Quran.pdf: $(NAME)Quran.ttf
@echo " GEN $@"
@mkdir -p $(DOC)
@fntsample --font-file $< --output-file [email protected] \
--write-outline --use-pango \
--style="header-font: Noto Sans Bold 12" \
--style="font-name-font: Noto Serif Bold 12" \
--style="table-numbers-font: Noto Sans 10" \
--style="cell-numbers-font:Noto Sans Mono 8"
@mutool clean -d -i -f -a [email protected] $@
@rm -f [email protected]
$(DOC)/FontTable-$(NAME).pdf: $(NAME)-Regular.ttf
@echo " GEN $@"
@mkdir -p $(DOC)
@fntsample --font-file $< --output-file [email protected] \
--write-outline --use-pango \
--style="header-font: Noto Sans Bold 12" \
--style="font-name-font: Noto Serif Bold 12" \
--style="table-numbers-font: Noto Sans 10" \
--style="cell-numbers-font:Noto Sans Mono 8"
@mutool clean -d -i -f -a [email protected] $@
@rm -f [email protected]
$(DOC)/Documentation-Arabic.pdf: $(DOC)/Documentation-Arabic.tex $(DTTF)
@echo " GEN $@"
@latexmk --norc --xelatex --quiet --output-directory=${DOC} $<
check: $(TEST) $(DTTF)
@echo "running tests"
@$(foreach font,$(DTTF),echo " OTS $(font)" && ots-sanitize --quiet $(font) &&) true
@$(PY) $(RUNTEST) $(TEST)
clean:
rm -rfv $(DTTF) $(WOFF) $(WOF2) $(CSSS) $(PDFS) $(SRC)/$(NAME)*.fea.pp
rm -rfv $(DOC)/documentation-arabic.{aux,log,toc}
distclean: clean
rm -rf {$(DIST),$(CDIST),$(WDIST)}{,.zip}
dist: all check pack doc
@rm -rf $(DIST) $(CDIST) $(WDIST)
@mkdir -p $(DIST) $(CDIST) $(WDIST)
@cp OFL.txt $(DIST)
@cp OFL.txt $(CDIST)
@cp OFL.txt $(WDIST)
@cp $(DTTF) $(DIST)
@cp $(DTTF) $(CDIST)
@cp README.md $(DIST)/README
@cp README.md $(CDIST)/README
@cp README-Arabic.md $(DIST)/README-Arabic
@cp README-Arabic.md $(CDIST)/README-Arabic
@cp NEWS.md $(DIST)/NEWS
@cp NEWS.md $(CDIST)/NEWS
@cp NEWS-Arabic.md $(DIST)/NEWS-Arabic
@cp NEWS-Arabic.md $(CDIST)/NEWS-Arabic
@cp $(NAME).fontspec $(CDIST)
@cp $(WOFF) $(WDIST)
@cp $(WOF2) $(WDIST)
@cp $(CSSS) $(WDIST)
@cp $(WEB)/README $(WDIST)
@cp $(PDFS) $(DIST)
@cp $(PDFS) $(CDIST)
@echo " ZIP $(DIST)"
@zip -rq $(DIST).zip $(DIST)
@echo " ZIP $(CDIST)"
@zip -rq $(CDIST).zip $(CDIST)
@echo " ZIP $(WDIST)"
@zip -rq $(WDIST).zip $(WDIST)