Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 90 lines (66 sloc) 2.207 kb
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
# TODO: try to find ttf2eot and ttfautohint globally installed first

PROJECT := $(notdir ${PWD})
TMP_PATH := /tmp/${PROJECT}-$(shell date +%s)

REMOTE_NAME ?= origin
REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)


TTF2EOT_BIN = ./support/ttf2eot/ttf2eot
TTFAUTOHINT_BIN = ./support/ttfautohint/frontend/ttfautohint


dist: font html


font:
@if test ! -f $(TTF2EOT_BIN) ; then \
echo "ttf2eot not found. run:" >&2 ; \
echo " make support" >&2 ; \
exit 128 ; \
fi
# @if test ! -f $(TTFAUTOHINT_BIN) ; then \
# echo "ttfautohint not found. run:" >&2 ; \
# echo " make support" >&2 ; \
# exit 128 ; \
# fi
./bin/fontbuild.py -c ./config.yml -t ./src/font_template.sfd -i ./src/svg -o ./font/entypo.ttf
$(TTFAUTOHINT_BIN) --latin-fallback --hinting-limit=200 --hinting-range-max=50 --symbol ./font/entypo.ttf ./font/entypo-hinted.ttf \
&& mv ./font/entypo-hinted.ttf ./font/entypo.ttf
./bin/fontconvert.py -i ./font/entypo.ttf -o ./font
$(TTF2EOT_BIN) < ./font/entypo.ttf >./font/entypo.eot


support: $(TTF2EOT_BIN) $(TTFAUTOHINT_BIN)


$(TTF2EOT_BIN):
cd ./support/ttf2eot \
&& $(MAKE) ttf2eot


$(TTFAUTOHINT_BIN):
cd ./support/ttfautohint \
&& ./configure --without-qt \
&& make
git clean -f -d ./support/ttfautohint


html:
./bin/parse_template.py -c ./config.yml ./src/css.mustache ./font/entypo.css
./bin/parse_template.py -c ./config.yml ./src/demo.mustache ./font/demo.html


gh-pages:
@if test -z ${REMOTE_REPO} ; then \
echo 'Remote repo URL not found' >&2 ; \
exit 128 ; \
fi
cp -r ./font ${TMP_PATH} && \
touch ${TMP_PATH}/.nojekyll
cd ${TMP_PATH} && \
git init && \
git add . && \
git commit -q -m 'refreshed gh-pages'
cd ${TMP_PATH} && \
git remote add remote ${REMOTE_REPO} && \
git push --force remote +master:gh-pages
rm -rf ${TMP_PATH}


dev-deps:
@if test 0 -ne `id -u` ; then \
echo "root priveledges are required" >&2 ; \
exit 128 ; \
fi
apt-get -qq install \
fontforge python python-fontforge libfreetype6-dev \
python-yaml python-pip \
build-essential \
autoconf automake libtool
pip -q install pystache argparse


clean:
git clean -f -x


.SILENT: dev-deps
.PHONY: font support
Something went wrong with that request. Please try again.