diff --git a/Makefile b/Makefile index 6ce4dda73..d0948c643 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ # all: all_web all_otf +VERSION := $(shell misc/version.py) + # generated.make is automatically generated by init.sh and defines depenencies for # all styles and alias targets include build/etc/generated.make @@ -56,8 +58,11 @@ build/%.woff: build/%.ttf # build/%.eot: build/%.ttf # ttf2eot "$<" > "$@" -# TTF -> zip -zip: all +ZIP_FILE_DIST := build/release/Interface-${VERSION}.zip +ZIP_FILE_DEV := build/release/Interface-${VERSION}-$(shell git rev-parse --short=10 HEAD).zip + +# zip intermediate +build/.zip.zip: all @rm -rf build/.zip @rm -f build/.zip.zip @mkdir -p \ @@ -65,17 +70,42 @@ zip: all "build/.zip/Interface (hinted TTF)" \ "build/.zip/Interface (TTF)" \ "build/.zip/Interface (OTF)" - cp -a build/dist/*.woff build/dist/*.woff2 "build/.zip/Interface (web)/" - cp -a build/dist/*.ttf "build/.zip/Interface (hinted TTF)/" - cp -a build/dist-unhinted/*.ttf "build/.zip/Interface (TTF)/" - cp -a build/dist-unhinted/*.otf "build/.zip/Interface (OTF)/" - cp -a misc/doc/install-*.txt "build/.zip/" - cd build/.zip && zip -v -X -r "../../build/.zip.zip" * - @mkdir -p build/release - @mv -f build/.zip.zip build/release/Interface-`date '+%Y%m%d'`.zip - @echo write build/release/Interface-`date '+%Y%m%d'`.zip + @cp -a build/dist/*.woff build/dist/*.woff2 "build/.zip/Interface (web)/" + @cp -a build/dist/*.ttf "build/.zip/Interface (hinted TTF)/" + @cp -a build/dist-unhinted/*.ttf "build/.zip/Interface (TTF)/" + @cp -a build/dist-unhinted/*.otf "build/.zip/Interface (OTF)/" + @cp -a misc/doc/install-*.txt "build/.zip/" + cd build/.zip && zip -v -X -r "../../build/.zip.zip" * >/dev/null && cd ../.. @rm -rf build/.zip +# zip +build/release/Interface-%.zip: build/.zip.zip + @mkdir -p "$(shell dirname "$@")" + @mv -f "$<" "$@" + @echo write "$@" + +zip: ${ZIP_FILE_DEV} +zip_dist: ${ZIP_FILE_DIST} + +dist: + @echo "Creating distribution for version ${VERSION}" + @if [ -f "${ZIP_FILE_DIST}" ]; \ + then echo "${ZIP_FILE_DIST} already exists. Bump version or remove the zip file to continue." >&2; \ + exit 1; \ + fi + @$(MAKE) zip_dist + rm -rf docs/font-files + mkdir docs/font-files + cp -a build/dist/*.woff build/dist/*.woff2 docs/font-files/ + @echo "——————————————————————————————————————————————————————————————————" + @echo "" + @echo "Next step:" + @echo " Create new release with ${ZIP_FILE_DIST} at" + @echo "" + @echo " https://github.com/rsms/interface/releases/new?tag=v${VERSION}" + @echo "" + @echo "——————————————————————————————————————————————————————————————————" + install_ttf: all_ttf @echo "Installing TTF files locally at ~/Library/Fonts/Interface" rm -rf ~/Library/Fonts/Interface @@ -103,4 +133,4 @@ _local/UnicodeData.txt: clean: rm -vrf build/tmp/* build/dist/Interface-*.* -.PHONY: all web clean install install_otf install_ttf deploy zip glyphinfo +.PHONY: all web clean install install_otf install_ttf deploy zip zip_dist dist glyphinfo diff --git a/docs/font-files/Interface-Bold.woff b/docs/font-files/Interface-Bold.woff index dda71c4e7..37284cc22 100644 Binary files a/docs/font-files/Interface-Bold.woff and b/docs/font-files/Interface-Bold.woff differ diff --git a/docs/font-files/Interface-Bold.woff2 b/docs/font-files/Interface-Bold.woff2 index 44f997076..635baab30 100644 Binary files a/docs/font-files/Interface-Bold.woff2 and b/docs/font-files/Interface-Bold.woff2 differ diff --git a/docs/font-files/Interface-BoldItalic.woff b/docs/font-files/Interface-BoldItalic.woff index e5a0dd04b..db4eccebf 100644 Binary files a/docs/font-files/Interface-BoldItalic.woff and b/docs/font-files/Interface-BoldItalic.woff differ diff --git a/docs/font-files/Interface-BoldItalic.woff2 b/docs/font-files/Interface-BoldItalic.woff2 index 363ac9d3f..c0309a2aa 100644 Binary files a/docs/font-files/Interface-BoldItalic.woff2 and b/docs/font-files/Interface-BoldItalic.woff2 differ diff --git a/docs/font-files/Interface-Medium.woff b/docs/font-files/Interface-Medium.woff index 426c58472..b5c306e3e 100644 Binary files a/docs/font-files/Interface-Medium.woff and b/docs/font-files/Interface-Medium.woff differ diff --git a/docs/font-files/Interface-Medium.woff2 b/docs/font-files/Interface-Medium.woff2 index 73f6105cd..bc3be192b 100644 Binary files a/docs/font-files/Interface-Medium.woff2 and b/docs/font-files/Interface-Medium.woff2 differ diff --git a/docs/font-files/Interface-MediumItalic.woff b/docs/font-files/Interface-MediumItalic.woff index 6b3927c24..764176b72 100644 Binary files a/docs/font-files/Interface-MediumItalic.woff and b/docs/font-files/Interface-MediumItalic.woff differ diff --git a/docs/font-files/Interface-MediumItalic.woff2 b/docs/font-files/Interface-MediumItalic.woff2 index 3c317c028..3a4f96272 100644 Binary files a/docs/font-files/Interface-MediumItalic.woff2 and b/docs/font-files/Interface-MediumItalic.woff2 differ diff --git a/docs/font-files/Interface-Regular.woff b/docs/font-files/Interface-Regular.woff index 6080f69f6..c7dc209bc 100644 Binary files a/docs/font-files/Interface-Regular.woff and b/docs/font-files/Interface-Regular.woff differ diff --git a/docs/font-files/Interface-Regular.woff2 b/docs/font-files/Interface-Regular.woff2 index b3cdb933e..8005b9437 100644 Binary files a/docs/font-files/Interface-Regular.woff2 and b/docs/font-files/Interface-Regular.woff2 differ diff --git a/docs/font-files/Interface-RegularItalic.woff b/docs/font-files/Interface-RegularItalic.woff index 1ef1a380b..e0994947b 100644 Binary files a/docs/font-files/Interface-RegularItalic.woff and b/docs/font-files/Interface-RegularItalic.woff differ diff --git a/docs/font-files/Interface-RegularItalic.woff2 b/docs/font-files/Interface-RegularItalic.woff2 index d558d3a02..5662de647 100644 Binary files a/docs/font-files/Interface-RegularItalic.woff2 and b/docs/font-files/Interface-RegularItalic.woff2 differ diff --git a/docs/res/sample.png b/docs/res/sample.png index 1a6375a3e..c56fd50ef 100644 Binary files a/docs/res/sample.png and b/docs/res/sample.png differ diff --git a/misc/version.py b/misc/version.py new file mode 100755 index 000000000..d6136ea9f --- /dev/null +++ b/misc/version.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# encoding: utf8 +from __future__ import print_function +import os, sys +from collections import OrderedDict +from ConfigParser import RawConfigParser + + +def main(): + srcDir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'src') + config = RawConfigParser(dict_type=OrderedDict) + config.read(os.path.join(srcDir, 'fontbuild.cfg')) + sys.stdout.write(config.get('main', 'version')) + +if __name__ == '__main__': + main() diff --git a/src/fontbuild.cfg b/src/fontbuild.cfg index 6213065fb..6178b156b 100644 --- a/src/fontbuild.cfg +++ b/src/fontbuild.cfg @@ -1,6 +1,6 @@ [main] -version: 1.0 +version: 1.1 foundry: rsms foundryurl: https://rsms.me/ designer: Rasmus Andersson