-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
63 lines (50 loc) · 1.86 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
# Copyright (c) 2020 Khaled Hosny
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
MAKEFLAGS := -sr
SHELL = bash
BUILDDIR = build
CONFIG = _config.yml
VERSION = $(shell python version.py $(CONFIG))
.SECONDARY:
.ONESHELL:
.PHONY: all
space :=
space +=
all: Qahiri-Regular.otf Qahiri-Regular.ttx
$(BUILDDIR)/%.unhinted.otf: Qahiri.glyphs $(CONFIG)
$(info $(space) BUILD $(*F))
mkdir -p $(BUILDDIR)
python build.py $< ${VERSION} $@ $(BUILDDIR)/$(*F).cidinfo $(BUILDDIR)/$(*F).cidmap
$(BUILDDIR)/%.unhinted.cff: $(BUILDDIR)/%.unhinted.otf
$(info $(space) CFF $(*F))
tx -cff +b -no_opt +d $< $@ 2>/dev/null
$(BUILDDIR)/%.hinted.cff: $(BUILDDIR)/%.unhinted.cff
$(info $(space) HINT $(*F))
psautohint $< -o $@
$(BUILDDIR)/%.hinted.cid: $(BUILDDIR)/%.hinted.cff
$(info $(space) CID $(*F))
mergefonts -cid $(BUILDDIR)/$(*F).cidinfo $@ $(BUILDDIR)/$(*F).cidmap $< 2>/dev/null
$(BUILDDIR)/%.cff: $(BUILDDIR)/%.hinted.cid
$(info $(space) SUBR $(*F))
tx -cff +S +b $< $@
%.otf: $(BUILDDIR)/%.cff $(BUILDDIR)/%.unhinted.otf
sfntedit -a CFF=$+ $@
%.ttx: $(BUILDDIR)/%.unhinted.otf
$(info $(space) TTX $(*F))
ttx -q -o $@ $<
dist:
mkdir Qahiri-$(VERSION)
cp Qahiri-Regular.otf README.txt README-Arabic.txt Qahiri-$(VERSION)
zip -r Qahiri-$(VERSION).zip Qahiri-$(VERSION)