-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
92 lines (75 loc) · 2.55 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
# Copyright (c) 2020-2024 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/>.
NAME = Mada
SHELL = bash
MAKEFLAGS := -srj
PYTHON := venv/bin/python3
SOURCEDIR = sources
FONTDIR = fonts
TESTDIR = tests
BUILDDIR = build
FONT = ${FONTDIR}/${NAME}.ttf
JSON = ${TESTDIR}/shaping.json
HTML = ${TESTDIR}/shaping.html
SVG = FontSample.svg
GLYPHSFILE = ${SOURCEDIR}/${NAME}.glyphspackage
define SAMPLE
صف خلق خود كمثل ٱلشمس إذ بزغت يحظى ٱلضجيع بها نجلاء معطار
endef
export SOURCE_DATE_EPOCH ?= $(shell stat -c "%Y" ${GLYPHSFILE})
TAG = $(shell git describe --tags --abbrev=0)
VERSION = ${TAG:v%=%}
DIST = ${NAME}-${VERSION}
.SECONDARY:
.ONESHELL:
.PHONY: all clean dist ttf test doc ${HTML}
all: ttf doc
ttf: ${FONT}
test: ${HTML}
expectation: ${JSON}
doc: ${SVG}
${FONT}: ${GLYPHSFILE}
$(info BUILD ${@F})
${PYTHON} -m fontmake $< \
--output-path=$@ \
-o variable \
--verbose=WARNING \
--master-dir="{tmp}" \
--flatten-components \
--filter ... \
--filter DecomposeTransformedComponentsFilter \
--filter "alifTools.filters::ClearPlaceholdersFilter()" \
--filter "alifTools.filters::FontVersionFilter(fontVersion=${VERSION})"
${TESTDIR}/%.json: ${TESTDIR}/%.yaml ${FONT}
$(info GEN ${@F})
${PYTHON} -m alifTools.shaping.update $< $@ ${FONT}
${TESTDIR}/shaping.html: ${FONT} ${TESTDIR}/shaping-config.yml
$(info SHAPE $(<F))
${PYTHON} -m alifTools.shaping.check $< ${TESTDIR}/shaping-config.yml $@
${SVG}: ${FONT}
$(info SVG ${@F})
${PYTHON} -m alifTools.sample $< \
-t "${SAMPLE}" \
--foreground=1F2328 \
--dark-foreground=D1D7E0 \
-o $@
dist: ${FONT} ${SVG}
$(info DIST ${DIST}.zip)
install -Dm644 -t ${DIST} ${FONT}
install -Dm644 -t ${DIST} README.md
install -Dm644 -t ${DIST} OFL.txt
zip -rq ${DIST}.zip ${DIST}
clean:
rm -rf ${BUILDDIR} ${FONT} ${SVG} ${DIST} ${DIST}.zip