forked from fontello/fontello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
168 lines (133 loc) · 5.03 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
PATH := ./node_modules/.bin:$(PATH)
# Add local versions of ttf2eot nd ttfautohint to the PATH
PATH := $(PATH):./support/font-builder/support/ttf2eot
PATH := $(PATH):./support/font-builder/support/ttfautohint/frontend
PATH := $(PATH):./support/font-builder/bin
FONTS += fontelico.font
FONTS += awesome-uni.font
FONTS += entypo
FONTS += typicons.font
FONTS += iconic-uni.font
FONTS += modernpics.font
FONTS += meteocons.font
FONTS += mfglabs.font
FONTS += maki.font
FONTS += zocial.font
FONTS += brandico.font
FONTS += elusive.font
FONTS += linecons.font
FONTS += websymbols-uni.font
FONT_CONFIGS = $(foreach f,$(FONTS),src/${f}/config.yml)
FONT_DIR = ./assets/embedded_fonts
help:
echo "make help - Print this help"
echo "make dev-server - Run dev server with autoreleat on files change"
echo "make rebuild - Rebuild embedded fonts"
echo "make lint - Lint sources with JSHint"
echo "make gh-pages - Build and push the project into gh-pages branch"
rebuild:
mkdir -p assets/embedded_fonts
# build single font
./build_embedded_fonts.js \
-i $(foreach f,$(FONTS), ./src/${f}) \
-o $(FONT_DIR)/fontello.svg \
-c lib/embedded_fonts/client_config.js \
-s lib/embedded_fonts/server_config.js
# convert to other formats
#fontforge -c 'font = fontforge.open("$(FONT_DIR)/fontello.svg"); font.generate("$(FONT_DIR)/fontello-unhinted.ttf")'
./node_modules/.bin/svg2ttf "$(FONT_DIR)/fontello.svg" "$(FONT_DIR)/fontello.ttf"
#ttfautohint --latin-fallback --hinting-limit=200 --hinting-range-max=50 --symbol $(FONT_DIR)/fontello-unhinted.ttf $(FONT_DIR)/fontello.ttf
#rm $(FONT_DIR)/fontello-unhinted.ttf
./node_modules/.bin/ttf2eot "$(FONT_DIR)/fontello.ttf" "$(FONT_DIR)/fontello.eot"
./node_modules/.bin/ttf2woff "$(FONT_DIR)/fontello.ttf" "$(FONT_DIR)/fontello.woff"
dev-server:
if test ! `which inotifywait` ; then \
echo "You need 'inotifywait' installed in order to run dev-server." >&2 ; \
echo " sudo apt-get install inotify-tools" >&2 ; \
exit 128 ; \
fi
./support/forever.sh
repl:
if test ! `which socat` ; then \
echo "You need `socat` installed in order to run repl." >&2 ; \
echo " sudo apt-get install socat" >&2 ; \
exit 128 ; \
fi
if test ! -e ./tmp/fontello-repl.sock ; then \
echo "You need to start fontello server with --repl." >&2 ; \
echo " ./fontello server --repl" >&2 ; \
exit 128 ; \
fi
socat - UNIX:./tmp/fontello-repl.sock
lint:
if test ! `which jshint` ; then \
echo "You need 'jshint' installed in order to run lint." >&2 ; \
exit 128 ; \
fi
jshint . --show-non-errors
dependencies:
@if test ! `which npm` ; then \
echo "Node.JS and NPM are required for html demo generation." >&2 ; \
echo "This is non-fatal error and you'll still be able to build font," >&2 ; \
echo "however, to build demo with >> make html << you need:" >&2 ; \
echo " - Install Node.JS and NPM" >&2 ; \
echo " - Run this task once again" >&2 ; \
exit 128 ; \
fi
@if test ! `which ttfautohint` ; then \
echo "Trying to install ttf-autohint from repository..." ; \
apt-cache policy -q=2 | grep -q 'Candidate' && \
sudo apt-get install ttfautohint && \
echo "SUCCESS" || echo "FAILED" ; \
fi
@if test ! `which ttfautohint` ; then \
echo "Trying to install ttf-autohint from Debian's repository..." ; \
curl --silent --show-error --output /tmp/ttfautohint.deb \
http://snapshot.debian.org/archive/debian/20130418T033038Z/pool/main/t/ttfautohint/ttfautohint_0.95-1_amd64.deb && \
sudo dpkg -i /tmp/ttfautohint.deb && \
echo "SUCCESS" || echo "FAILED" ; \
fi
cleanup:
# cleanup assets
rm -rf public/assets
rm -rf .cache
# needed for travis
setup:
if test ! -e ./config/application.yml ; then \
cp ./config/application.yml.example ./config/application.yml ; \
fi
test: cleanup lint
@NODECA_ENV=test node ./fontello.js migrate --all
@NODECA_ENV=test NODECA_NOMINIFY=1 ./fontello.js test
todo:
grep 'TODO' -n -r ./lib 2>/dev/null || test true
#FONTELLO_HOST ?= http://fontello.com
FONTELLO_HOST ?= http://localhost:3000
FONTELLO_DIR ?= ./assets/icons/src
fontopen:
@if test ! `which curl` ; then \
echo 'Install curl first.' >&2 ; \
exit 128 ; \
fi
curl --silent --show-error --fail --output .fontello \
--form "config=@${FONTELLO_DIR}/config.json" \
${FONTELLO_HOST}
x-www-browser ${FONTELLO_HOST}/`cat .fontello`
fontsave:
@if test ! `which unzip` ; then \
echo 'Install unzip first.' >&2 ; \
exit 128 ; \
fi
@if test ! -e .fontello ; then \
echo 'Run `make fontopen` first.' >&2 ; \
exit 128 ; \
fi
rm -rf .fontello.src .fontello.zip
curl --silent --show-error --fail --output .fontello.zip \
${FONTELLO_HOST}/`cat .fontello`/get
unzip .fontello.zip -d .fontello.src
rm -rf ${FONTELLO_DIR}
mv `find ./.fontello.src -maxdepth 1 -name 'fontello-*'` ${FONTELLO_DIR}
rm -rf .fontello.src .fontello.zip
.PHONY: help rebuild dev-setup lint gh-pages todo dev-server repl fontopen
.SILENT: help rebuild dev-setup lint todo