File: Makefile

package info (click to toggle)
fonts-ebgaramond 0.015+git20130628-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 150,984 kB
  • ctags: 90
  • sloc: python: 913; makefile: 85
file content (107 lines) | stat: -rw-r--r-- 2,767 bytes parent folder | download
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
NAME=EBGaramond
VERSION=0.015d

SRC=SFD
BLD=build
WEB=web
SPEC=specimen
PACK=$(NAME)-$(VERSION)
WPCK=$(NAME)-$(VERSION)-web
DIST=$(NAME)-$(VERSION)-complete

#Call script through fontforge, not python. https://github.com/fontforge/fontforge/issues/528
#FF=fontforge
#Return to python because we don’t scale the font any longer.
PY=python
SCRIPT=tools/makefont.py
SFNTTOOL=java -jar sfnttool.jar

#SIZES=08 12
#STYLES=Regular SC Allsc Italic Bold
#SPECIAL=Initials InitialsF1 InitialsF2
FONTS=08-Regular 08-SC 08-Italic 12-Regular 12-Italic  -Initials -InitialsF1 -InitialsF2  #12-Bold

SFD=$(FONTS:%=$(SRC)/$(NAME)%.sfdir)
OTF=$(FONTS:%=$(BLD)/$(NAME)%.otf)
TTF=$(FONTS:%=$(BLD)/$(NAME)%.ttf)
WTT=$(FONTS:%=$(WEB)/$(NAME)%.ttf)
WOF=$(FONTS:%=$(WEB)/$(NAME)%.woff)
EOT=$(FONTS:%=$(WEB)/$(NAME)%.eot)
PDF=$(FONTS:%=$(SPEC)/$(NAME)%-Glyphs.pdf)

all: otf ttf web # pdfs
pack: dpack wpack

otf: $(OTF)
ttf: $(TTF)
web: $(WOF) $(EOT)
pdfs: $(PDF)

$(BLD):
	mkdir $@

$(BLD)/%.otf: $(SRC)/%.sfdir Makefile $(SCRIPT) $(BLD)
	@echo "Generating	$@"
	@$(PY) $(SCRIPT) $< $@ $(VERSION) 

$(BLD)/%.ttf: $(SRC)/%.sfdir Makefile $(SCRIPT) $(BLD)
	@echo "Generating	$@"
	@$(PY) $(SCRIPT) $< $@ $(VERSION) 
	@echo "Autohinting	$@"
	@ttfautohint -x 0 -w 'gGD' $@ $@.tmp
	@mv $@.tmp $@

$(WEB)/%.woff: $(BLD)/%.ttf
	@echo "Generating	$@"
	@$(SFNTTOOL) -w $< $@
#	@sfnt2woff $<

$(WEB)/%.eot: $(BLD)/%.ttf
	@echo "Generating	$@"
	@$(SFNTTOOL) -e -x $< $@
#	@ttf2eot $< > $@

$(SPEC)/%-Glyphs.pdf: $(BLD)/%.ttf 
	@echo "Generating	$@"
	@fntsample -f $< -o $@ -l > $@.outline
	@pdfoutline $@ $@.outline $@
	@rm $@.outline

dpack: $(OTF) $(TTF)
	@echo "Packing fonts to zipfile"
	@mkdir -p $(PACK)/otf
	@mkdir -p $(PACK)/ttf
	@mkdir -p $(PACK)/specimen
	@cp $(OTF) $(PACK)/otf
	@cp $(TTF) $(PACK)/ttf
#	@cp $(PDF) $(PACK)/specimen        #Temporarily out of order
	@cp $(SPEC)/Specimen.pdf  $(PACK)/specimen
	@cp README.markdown README.xelualatex COPYING $(PACK)
	@zip -r $(PACK).zip $(PACK)

wpack: $(WOF) $(EOT)
	@echo "Packing webfonts to zipfile"
	@mkdir -p $(WPCK)
	@cp $(WOF) $(EOT) README.markdown COPYING $(WPCK)
	@zip -r $(WPCK).zip $(WPCK)

dist: $(OTF) $(TTF)
	@echo "Making dist tarball"
	@mkdir -p $(DIST)/$(SRC)
	@mkdir -p $(DIST)/$(BLD)
	@mkdir -p $(DIST)/$(WEB)
	@mkdir -p $(DIST)/tools
	@mkdir -p $(DIST)/$(SPEC)
	@cp -r $(SFD) $(DIST)/$(SRC)
	@cp $(OTF) $(TTF) $(DIST)/$(BLD)
	@cp $(WOF) $(EOT) $(DIST)/$(WEB)
	@cp $(PDF) $(SPEC)/Specimen.pdf $(DIST)/$(SPEC)
	@cp $(SCRIPT) $(DIST)/tools
	@cp Makefile README.markdown README.xelualatex COPYING $(DIST)
	@zip -r $(DIST).zip $(DIST)

cleanpack:
	@rm -rf $(PACK) $(PACK).zip  $(WPCK) $(WPCK).zip

clean:
	@rm -rf $(OTF) $(TTF) $(WTT) $(WOF) $(EOT) $(PDF) $(PACK) $(PACK).zip $(WPCK) $(WPCK).zip $(DIST) $(DIST).zip $(BLD)