blob: 5875d080742bfbb02fc5c981e886ee3d7ef1fc4e (
plain)
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
|
.PHONY: all clean ttf web pack check
VERSION=0.100
TOOLS=tools
SRC=sources
WEB=web
DOC=documentation
TESTS=test-suite
FONTS=amiri-regular amiri-slanted
DOCS=README README-Arabic NEWS NEWS-Arabic
BUILD=$(TOOLS)/build.py
RUNTEST=$(TOOLS)/runtest.py
FF=python $(BUILD)
MKEOT=ttf2eot
MKWOFF=sfnt2woff
SFDS=$(FONTS:%=$(SRC)/%.sfd)
DTTF=$(FONTS:%=%.ttf)
WTTF=$(FONTS:%=$(WEB)/%.ttf)
WOFF=$(FONTS:%=$(WEB)/%.woff)
EOTS=$(FONTS:%=$(WEB)/%.eot)
PDFS=$(DOC)/amiri-table.pdf
CSSS=$(WEB)/amiri.css
FEAT=$(wildcard $(SRC)/*.fea)
TEST=$(wildcard $(TESTS)/*.test)
DOCFILES=$(DOCS:%=$(DOC)/%.txt)
license=OFL.txt OFL-FAQ.txt
all: ttf web
ttf: $(DTTF)
web: $(WTTF) $(WOFF) $(EOTS) $(CSSS)
doc: $(PDFS)
$(WEB)/%.ttf: %.ttf $(BUILD)
@echo " FF\t$@"
@mkdir -p $(WEB)
@$(FF) --input $< --output $@ --web
%.ttf: $(SRC)/%.sfd $(SRC)/%.fea $(FEAT) $(BUILD)
@echo " FF\t$@"
@$(FF) --input $< --output $@ --desktop --feature-file $(<:%.sfd=%.fea) --version $(VERSION) --no-localised-name
%-slanted.ttf: $(SRC)/%-regular.sfd $(SRC)/%-regular.fea $(FEAT) $(BUILD)
@echo " FF\t$@"
@$(FF) --input $< --output $@ --desktop --feature-file $(<:%.sfd=%.fea) --version $(VERSION) --no-localised-name --slant=7
$(WEB)/%.woff: $(WEB)/%.ttf
@echo " FF\t$@"
@mkdir -p $(WEB)
@$(MKWOFF) $<
$(WEB)/%.eot: $(WEB)/%.ttf
@echo " FF\t$@"
@mkdir -p $(WEB)
@$(MKEOT) $< > $@
$(WEB)/%.css: $(WTTF) $(BUILD)
@echo " GEN\t$@"
@mkdir -p $(WEB)
@$(FF) --css --input "$(WTTF)" --output $@ --version $(VERSION)
$(DOC)/amiri-table.pdf: amiri-regular.ttf
@echo " GEN\t$@"
@mkdir -p $(DOC)
@fntsample --font-file $< --output-file $@.tmp --print-outline > $@.txt
@pdfoutline $@.tmp $@.txt $@
@rm -f $@.tmp $@.txt
check: $(TEST) $(DTTF)
ifeq ($(shell which hb-shape),)
@echo "hb-shape not found, skipping tests"
else
@echo "running tests"
@$(RUNTEST) $(TEST)
endif
clean:
rm -rfv $(DTTF) $(WTTF) $(WOFF) $(EOTS) $(CSSS) $(PDFS)
|