-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
87 lines (66 loc) · 2.26 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
NAME=ArefRuqaa
LATIN=EulerText
FONTDIR=fonts
BUILDDIR=build
SOURCEDIR=sources
SCRIPTDIR=scripts
INSTANCEDIR=$(BUILDDIR)/instance_ufos
DIST=$(NAME)-$(VERSION)
PY := python3
FONTS=Regular Bold
TTF=$(FONTS:%=$(FONTDIR)/$(NAME)-%.ttf) $(FONTS:%=$(FONTDIR)/$(NAME)Ink-%.ttf)
SAMPLE=sample.svg
TAG=$(shell git describe --tags --abbrev=0)
VERSION=$(TAG:v%=%)
MAKEFLAGS := -r -s
export SOURCE_DATE_EPOCH := 0
export FONTTOOLS_LOOKUP_DEBUGGING := 1
.SECONDARY:
all: ttf doc
ttf: $(TTF)
doc: $(SAMPLE)
FM_OPTS = --verbose WARNING \
--flatten-components \
--no-production-names
FM_OPTS2 = $(FM_OPTS) \
--master-dir="{tmp}" \
--instance-dir="{tmp}"
$(BUILDDIR)/$(NAME).glyphspackage: $(SOURCEDIR)/$(NAME).glyphspackage
echo " PREPARE $(@F)"
mkdir -p $(BUILDDIR)
$(PY) $(SCRIPTDIR)/setversion.py $< $@ $(VERSION)
$(BUILDDIR)/$(NAME).designspace: $(BUILDDIR)/$(NAME).glyphspackage
echo " UFO $(@F)"
mkdir -p $(BUILDDIR)
glyphs2ufo $< -m $(BUILDDIR) -n "$(PWD)"/$(INSTANCEDIR) \
--generate-GDEF \
--write-public-skip-export-glyphs \
--no-store-editor-state \
--no-preserve-glyphsapp-metadata \
--minimal
$(BUILDDIR)/$(LATIN)-%: $(SOURCEDIR)/$(LATIN).glyphs
echo " BUILD $(@F)"
mkdir -p $(BUILDDIR)
$(PY) -m fontmake $(FM_OPTS2) -g $< -i ".* $(basename $*)" -o $(subst .,,$(suffix $(@F))) --output-path $@
$(BUILDDIR)/$(NAME)-%: $(BUILDDIR)/$(NAME).designspace
echo " BUILD $(@F)"
mkdir -p $(BUILDDIR)
$(PY) -m fontmake $(FM_OPTS) $(BUILDDIR)/$(basename $(@F)).ufo -o $(subst .,,$(suffix $(@F))) --output-path $@
$(FONTDIR)/$(NAME)-%: $(BUILDDIR)/$(NAME)-% $(BUILDDIR)/$(LATIN)-%
echo " MERGE $(@F)"
$(PY) $(SCRIPTDIR)/merge.py --out-file=$@ $+
$(FONTDIR)/$(NAME)Ink-%: $(BUILDDIR)/$(NAME)-% $(BUILDDIR)/$(LATIN)-%
echo " MERGE $(@F)"
$(PY) $(SCRIPTDIR)/merge.py --color --family="Aref Ruqaa" --suffix=Ink --out-file=$@ $+
$(SAMPLE): $(TTF)
echo " SAMPLE $(@F)"
python3 $(SCRIPTDIR)/mksample.py $+ \
--output=$@ \
--text="﴿الحُبُّ سَمَاءٌ لَا تُمطرُ غَيرَ الأَحلَامِ﴾"
dist: $(TTF)
install -Dm644 -t $(DIST) $(TTF)
install -Dm644 -t $(DIST) OFL.txt
install -Dm644 -t $(DIST) README.md
zip -r $(DIST).zip $(DIST)
clean:
rm -rf $(BUILDDIR) $(TTF) $(DIST) $(DIST).zip