2017-08-22 09:05:20 +02:00
|
|
|
# Targets:
|
2018-09-09 21:30:21 +02:00
|
|
|
# all Build everything
|
|
|
|
# test Build and test everyything (implies all_check)
|
|
|
|
# install Build and install all OTF files. (currently Mac-only)
|
|
|
|
# zip Build a complete release-grade ZIP archive of all fonts.
|
|
|
|
# dist Create a new release distribution. Does everything.
|
2018-09-04 01:06:33 +02:00
|
|
|
#
|
2018-09-09 21:30:21 +02:00
|
|
|
# all_const Build all non-variable files
|
|
|
|
# all_const_hinted Build all non-variable files with hints
|
|
|
|
# all_var Build all variable files
|
2018-09-25 18:53:25 +02:00
|
|
|
# all_var_hinted Build all variable files with hints (disabled)
|
2018-09-09 21:30:21 +02:00
|
|
|
#
|
|
|
|
# all_otf Build all OTF files into FONTDIR/const
|
|
|
|
# all_ttf Build all TTF files into FONTDIR/const
|
|
|
|
# all_ttf_hinted Build all TTF files with hints into FONTDIR/const-hinted
|
|
|
|
# all_web Build all WOFF files into FONTDIR/const
|
|
|
|
# all_web_hinted Build all WOFF files with hints into FONTDIR/const-hinted
|
|
|
|
# all_var Build all variable font files into FONTDIR/var
|
|
|
|
# all_var_hinted Build all variable font files with hints into
|
|
|
|
# FONTDIR/var-hinted
|
2018-09-04 01:06:33 +02:00
|
|
|
#
|
2018-09-09 22:20:14 +02:00
|
|
|
# designspace Build src/Inter-UI.designspace from src/Inter-UI.glyphs
|
|
|
|
#
|
2018-09-04 01:06:33 +02:00
|
|
|
# Style-specific targets:
|
2018-09-09 21:30:21 +02:00
|
|
|
# STYLE_otf Build OTF file for STYLE into FONTDIR/const
|
|
|
|
# STYLE_ttf Build TTF file for STYLE into FONTDIR/const
|
|
|
|
# STYLE_ttf_hinted Build TTF file for STYLE with hints into
|
|
|
|
# FONTDIR/const-hinted
|
|
|
|
# STYLE_web Build WOFF files for STYLE into FONTDIR/const
|
|
|
|
# STYLE_web_hinted Build WOFF files for STYLE with hints into
|
|
|
|
# FONTDIR/const-hinted
|
2018-09-04 01:06:33 +02:00
|
|
|
# STYLE_check Build & check OTF and TTF files for STYLE
|
2017-08-22 09:05:20 +02:00
|
|
|
#
|
2018-09-09 21:30:21 +02:00
|
|
|
# "build" directory output structure:
|
|
|
|
# fonts
|
|
|
|
# const
|
|
|
|
# const-hinted
|
|
|
|
# var
|
2018-09-25 18:53:25 +02:00
|
|
|
# var-hinted (disabled)
|
2018-09-09 21:30:21 +02:00
|
|
|
#
|
|
|
|
FONTDIR = build/fonts
|
|
|
|
|
2018-09-25 18:53:25 +02:00
|
|
|
all: all_const all_const_hinted all_var
|
2018-09-09 21:30:21 +02:00
|
|
|
|
|
|
|
all_const: all_otf all_ttf all_web
|
|
|
|
all_const_hinted: all_ttf_hinted all_web_hinted
|
2018-10-08 03:27:12 +02:00
|
|
|
all_var: \
|
|
|
|
$(FONTDIR)/var/Inter-UI.var.woff2 \
|
|
|
|
$(FONTDIR)/var/Inter-UI-upright.var.woff2 \
|
|
|
|
$(FONTDIR)/var/Inter-UI-italic.var.woff2 \
|
|
|
|
$(FONTDIR)/var/Inter-UI.var.ttf \
|
|
|
|
$(FONTDIR)/var/Inter-UI-upright.var.ttf \
|
|
|
|
$(FONTDIR)/var/Inter-UI-italic.var.ttf
|
2017-11-27 05:26:15 +01:00
|
|
|
|
2018-09-25 18:53:25 +02:00
|
|
|
# Disabled. See https://github.com/rsms/inter/issues/75
|
|
|
|
# all_var_hinted: $(FONTDIR)/var-hinted/Inter-UI.var.ttf $(FONTDIR)/var-hinted/Inter-UI.var.woff2
|
|
|
|
# .PHONY: all_var_hinted
|
|
|
|
|
|
|
|
.PHONY: all_const all_const_hinted all_var
|
2018-09-10 19:21:35 +02:00
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
export PATH := $(PWD)/build/venv/bin:$(PATH)
|
2017-08-22 21:46:29 +02:00
|
|
|
|
2017-08-22 09:05:20 +02:00
|
|
|
# generated.make is automatically generated by init.sh and defines depenencies for
|
|
|
|
# all styles and alias targets
|
|
|
|
include build/etc/generated.make
|
|
|
|
|
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
# TTF -> WOFF2
|
|
|
|
build/%.woff2: build/%.ttf
|
|
|
|
woff2_compress "$<"
|
|
|
|
|
|
|
|
# TTF -> WOFF
|
|
|
|
build/%.woff: build/%.ttf
|
|
|
|
ttf2woff -O -t woff "$<" "$@"
|
|
|
|
|
2018-09-10 02:04:36 +02:00
|
|
|
# make sure intermediate TTFs are not gc'd by make
|
|
|
|
.PRECIOUS: build/%.ttf
|
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
# TTF -> EOT (disabled)
|
|
|
|
# build/%.eot: build/%.ttf
|
|
|
|
# ttf2eot "$<" > "$@"
|
|
|
|
|
|
|
|
|
2018-09-14 19:55:23 +02:00
|
|
|
# Master UFO -> OTF, TTF
|
2018-09-04 01:06:33 +02:00
|
|
|
|
2018-09-14 19:55:23 +02:00
|
|
|
all_ufo_masters = $(Regular_ufo_d) $(Black_ufo_d) $(Italic_ufo_d) $(BlackItalic_ufo_d)
|
|
|
|
|
2018-10-08 03:27:12 +02:00
|
|
|
$(FONTDIR)/var/%.var.ttf: src/%.designspace $(all_ufo_masters)
|
|
|
|
misc/fontbuild compile-var -o $@ $<
|
2018-09-09 21:30:21 +02:00
|
|
|
|
|
|
|
$(FONTDIR)/const/Inter-UI-Regular.%: src/Inter-UI.designspace $(Regular_ufo_d)
|
2018-09-03 21:55:49 +02:00
|
|
|
misc/fontbuild compile -o $@ src/Inter-UI-Regular.ufo
|
|
|
|
|
2018-09-09 21:30:21 +02:00
|
|
|
$(FONTDIR)/const/Inter-UI-Black.%: src/Inter-UI.designspace $(Black_ufo_d)
|
2018-09-03 21:55:49 +02:00
|
|
|
misc/fontbuild compile -o $@ src/Inter-UI-Black.ufo
|
|
|
|
|
2018-09-10 19:21:35 +02:00
|
|
|
$(FONTDIR)/const/Inter-UI-Italic.%: src/Inter-UI.designspace $(Italic_ufo_d)
|
2018-09-12 18:44:07 +02:00
|
|
|
misc/fontbuild compile -o $@ src/Inter-UI-Italic.ufo
|
2018-09-10 19:21:35 +02:00
|
|
|
|
2018-09-14 17:50:06 +02:00
|
|
|
$(FONTDIR)/const/Inter-UI-BlackItalic.%: src/Inter-UI.designspace $(BlackItalic_ufo_d)
|
|
|
|
misc/fontbuild compile -o $@ src/Inter-UI-BlackItalic.ufo
|
|
|
|
|
2018-09-14 19:55:23 +02:00
|
|
|
# Instance UFO -> OTF, TTF
|
|
|
|
|
|
|
|
$(FONTDIR)/const/Inter-UI-%.otf: build/ufo/Inter-UI-%.ufo src/Inter-UI.designspace $(all_ufo_masters)
|
2018-09-03 21:55:49 +02:00
|
|
|
misc/fontbuild compile -o $@ $<
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2018-09-14 19:55:23 +02:00
|
|
|
$(FONTDIR)/const/Inter-UI-%.ttf: build/ufo/Inter-UI-%.ufo src/Inter-UI.designspace $(all_ufo_masters)
|
2018-09-03 21:55:49 +02:00
|
|
|
misc/fontbuild compile -o $@ $<
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2017-09-23 21:19:01 +02:00
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
# designspace <- glyphs file
|
|
|
|
src/Inter-UI.designspace: src/Inter-UI.glyphs
|
|
|
|
misc/fontbuild glyphsync $<
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2018-09-09 22:20:14 +02:00
|
|
|
designspace: src/Inter-UI.designspace
|
|
|
|
.PHONY: designspace
|
|
|
|
|
2018-09-10 19:21:35 +02:00
|
|
|
# short-circuit Make for performance
|
2018-09-04 01:06:33 +02:00
|
|
|
src/Inter-UI.glyphs:
|
|
|
|
@true
|
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
# instance UFOs <- master UFOs
|
2018-09-04 01:06:33 +02:00
|
|
|
build/ufo/Inter-UI-%.ufo: src/Inter-UI.designspace $(Regular_ufo_d) $(Black_ufo_d)
|
2018-09-03 21:55:49 +02:00
|
|
|
misc/fontbuild instancegen src/Inter-UI.designspace $*
|
|
|
|
|
2018-09-10 02:04:36 +02:00
|
|
|
# make sure intermediate UFOs are not gc'd by make
|
|
|
|
.PRECIOUS: build/ufo/Inter-UI-%.ufo
|
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
# Note: The seemingly convoluted dependency graph above is required to
|
|
|
|
# make sure that glyphsync and instancegen are not run in parallel.
|
|
|
|
|
|
|
|
|
|
|
|
# hinted TTF files via autohint
|
2018-09-09 21:30:21 +02:00
|
|
|
$(FONTDIR)/const-hinted/%.ttf: $(FONTDIR)/const/%.ttf
|
|
|
|
mkdir -p "$(dir $@)"
|
|
|
|
ttfautohint --fallback-stem-width=256 --no-info --composites "$<" "$@"
|
|
|
|
|
2018-09-25 18:53:25 +02:00
|
|
|
# $(FONTDIR)/var-hinted/%.ttf: $(FONTDIR)/var/%.ttf
|
|
|
|
# mkdir -p "$(dir $@)"
|
|
|
|
# ttfautohint --fallback-stem-width=256 --no-info --composites "$<" "$@"
|
2018-09-09 21:30:21 +02:00
|
|
|
|
2018-09-10 02:04:36 +02:00
|
|
|
# make sure intermediate TTFs are not gc'd by make
|
2018-10-08 03:27:12 +02:00
|
|
|
.PRECIOUS: $(FONTDIR)/const/%.ttf $(FONTDIR)/const-hinted/%.ttf $(FONTDIR)/var/%.var.ttf
|
2018-09-10 02:04:36 +02:00
|
|
|
|
2018-09-09 21:30:21 +02:00
|
|
|
# check var
|
|
|
|
all_check_var: $(FONTDIR)/var/Inter-UI.var.ttf
|
|
|
|
misc/fontbuild checkfont $^
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2018-09-03 21:55:49 +02:00
|
|
|
# test runs all tests
|
2018-09-09 21:30:21 +02:00
|
|
|
# Note: all_check_const is generated by init.sh and runs "fontbuild checkfont"
|
2018-09-03 21:55:49 +02:00
|
|
|
# on all otf and ttf files.
|
2018-09-09 21:30:21 +02:00
|
|
|
test: all_check_const all_check_var
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2018-09-04 01:06:33 +02:00
|
|
|
# load version, used by zip and dist
|
|
|
|
VERSION := $(shell cat version.txt)
|
2017-11-29 02:13:15 +01:00
|
|
|
|
2018-09-04 01:06:33 +02:00
|
|
|
# distribution zip files
|
2017-09-19 00:58:34 +02:00
|
|
|
ZIP_FILE_DIST := build/release/Inter-UI-${VERSION}.zip
|
|
|
|
ZIP_FILE_DEV := build/release/Inter-UI-${VERSION}-$(shell git rev-parse --short=10 HEAD).zip
|
2017-08-22 21:46:29 +02:00
|
|
|
|
2018-09-09 21:30:21 +02:00
|
|
|
ZD = build/tmp/zip
|
2018-09-04 01:06:33 +02:00
|
|
|
# intermediate zip target that creates a zip file at build/tmp/a.zip
|
2018-09-09 21:30:21 +02:00
|
|
|
build/tmp/a.zip: all
|
|
|
|
@rm -rf "$(ZD)"
|
2018-09-04 01:06:33 +02:00
|
|
|
@rm -f build/tmp/a.zip
|
2017-08-22 09:05:20 +02:00
|
|
|
@mkdir -p \
|
2018-09-09 21:30:21 +02:00
|
|
|
"$(ZD)/Inter UI (web)" \
|
|
|
|
"$(ZD)/Inter UI (web hinted)" \
|
|
|
|
"$(ZD)/Inter UI (TTF)" \
|
|
|
|
"$(ZD)/Inter UI (TTF hinted)" \
|
|
|
|
"$(ZD)/Inter UI (TTF variable)" \
|
|
|
|
"$(ZD)/Inter UI (OTF)"
|
2018-09-25 18:53:25 +02:00
|
|
|
# "$(ZD)/Inter UI (TTF variable hinted)"
|
2018-09-09 21:30:21 +02:00
|
|
|
# copy font files
|
|
|
|
cp -a $(FONTDIR)/const/*.woff \
|
|
|
|
$(FONTDIR)/const/*.woff2 \
|
|
|
|
$(FONTDIR)/var/*.woff2 "$(ZD)/Inter UI (web)/"
|
2018-09-25 18:53:25 +02:00
|
|
|
# cp -a $(FONTDIR)/const-hinted/*.woff \
|
|
|
|
# $(FONTDIR)/const-hinted/*.woff2 \
|
|
|
|
# $(FONTDIR)/var-hinted/*.woff2 "$(ZD)/Inter UI (web hinted)/"
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -a $(FONTDIR)/const-hinted/*.woff \
|
|
|
|
$(FONTDIR)/const-hinted/*.woff2 \
|
2018-09-25 18:53:25 +02:00
|
|
|
"$(ZD)/Inter UI (web hinted)/"
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -a $(FONTDIR)/const/*.ttf "$(ZD)/Inter UI (TTF)/"
|
|
|
|
cp -a $(FONTDIR)/const-hinted/*.ttf "$(ZD)/Inter UI (TTF hinted)/"
|
|
|
|
cp -a $(FONTDIR)/var/*.ttf "$(ZD)/Inter UI (TTF variable)/"
|
2018-09-25 18:53:25 +02:00
|
|
|
# cp -a $(FONTDIR)/var-hinted/*.ttf "$(ZD)/Inter UI (TTF variable hinted)/"
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -a $(FONTDIR)/const/*.otf "$(ZD)/Inter UI (OTF)/"
|
|
|
|
# copy misc stuff
|
|
|
|
cp -a misc/dist/inter-ui.css "$(ZD)/Inter UI (web)/"
|
|
|
|
cp -a misc/dist/inter-ui.css "$(ZD)/Inter UI (web hinted)/"
|
|
|
|
cp -a misc/dist/*.txt "$(ZD)/"
|
|
|
|
cp -a LICENSE.txt "$(ZD)/"
|
|
|
|
# zip
|
|
|
|
cd $(ZD) && zip -q -X -r "../../../$@" * && cd ../..
|
|
|
|
@rm -rf $(ZD)
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2017-08-22 21:46:29 +02:00
|
|
|
# zip
|
2018-09-04 01:06:33 +02:00
|
|
|
build/release/Inter-UI-%.zip: build/tmp/a.zip
|
2017-08-22 21:46:29 +02:00
|
|
|
@mkdir -p "$(shell dirname "$@")"
|
|
|
|
@mv -f "$<" "$@"
|
|
|
|
@echo write "$@"
|
2018-09-25 15:58:10 +02:00
|
|
|
@sh -c "if [ -f /usr/bin/open ]; then /usr/bin/open --reveal '$@'; fi"
|
2017-08-22 21:46:29 +02:00
|
|
|
|
|
|
|
zip: ${ZIP_FILE_DEV}
|
2017-11-30 04:01:13 +01:00
|
|
|
zip_dist: pre_dist test ${ZIP_FILE_DIST}
|
2018-09-04 01:06:33 +02:00
|
|
|
.PHONY: zip zip_dist
|
2017-08-22 21:46:29 +02:00
|
|
|
|
2018-09-04 04:01:04 +02:00
|
|
|
# distribution
|
2017-08-24 09:45:10 +02:00
|
|
|
pre_dist:
|
2017-08-22 21:46:29 +02:00
|
|
|
@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
|
2017-09-25 19:38:15 +02:00
|
|
|
|
2018-09-28 21:58:16 +02:00
|
|
|
dist: zip_dist docs
|
2018-09-04 01:06:33 +02:00
|
|
|
misc/tools/versionize-css.py
|
2017-08-22 21:46:29 +02:00
|
|
|
@echo "——————————————————————————————————————————————————————————————————"
|
|
|
|
@echo ""
|
2017-09-12 07:42:54 +02:00
|
|
|
@echo "Next steps:"
|
|
|
|
@echo ""
|
|
|
|
@echo "1) Commit & push changes"
|
|
|
|
@echo ""
|
|
|
|
@echo "2) Create new release with ${ZIP_FILE_DIST} at"
|
2017-09-19 00:58:34 +02:00
|
|
|
@echo " https://github.com/rsms/inter/releases/new?tag=v${VERSION}"
|
2017-08-22 21:46:29 +02:00
|
|
|
@echo ""
|
2018-09-04 04:01:04 +02:00
|
|
|
@echo "3) Bump version in version.txt (to the next future version)"
|
2017-08-22 21:46:29 +02:00
|
|
|
@echo ""
|
|
|
|
@echo "——————————————————————————————————————————————————————————————————"
|
|
|
|
|
2018-09-28 21:58:16 +02:00
|
|
|
docs: docs_fonts
|
|
|
|
$(MAKE) -j docs_info
|
|
|
|
|
2018-09-04 01:06:33 +02:00
|
|
|
docs_info: docs/_data/fontinfo.json docs/lab/glyphinfo.json docs/glyphs/metrics.json
|
|
|
|
|
|
|
|
docs_fonts:
|
2017-09-12 07:42:54 +02:00
|
|
|
rm -rf docs/font-files
|
|
|
|
mkdir docs/font-files
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -a $(FONTDIR)/const/*.woff \
|
|
|
|
$(FONTDIR)/const/*.woff2 \
|
|
|
|
$(FONTDIR)/const/*.otf \
|
2018-10-08 03:27:12 +02:00
|
|
|
$(FONTDIR)/var/*.* \
|
2018-09-09 21:30:21 +02:00
|
|
|
docs/font-files/
|
2017-09-12 07:42:54 +02:00
|
|
|
|
2018-09-28 21:58:16 +02:00
|
|
|
.PHONY: docs docs_info docs_fonts
|
|
|
|
|
2018-09-04 02:00:19 +02:00
|
|
|
docs/_data/fontinfo.json: docs/font-files/Inter-UI-Regular.otf misc/tools/fontinfo.py
|
|
|
|
misc/tools/fontinfo.py -pretty $< > docs/_data/fontinfo.json
|
2018-09-04 01:06:33 +02:00
|
|
|
|
2018-09-23 02:36:13 +02:00
|
|
|
docs/lab/glyphinfo.json: build/UnicodeData.txt misc/tools/gen-glyphinfo.py $(all_ufo_masters)
|
2018-09-04 01:06:33 +02:00
|
|
|
misc/tools/gen-glyphinfo.py -ucd $< src/Inter-UI-*.ufo > $@
|
|
|
|
|
2018-09-04 02:00:19 +02:00
|
|
|
docs/glyphs/metrics.json: $(Regular_ufo_d) misc/tools/gen-metrics-and-svgs.py
|
|
|
|
misc/tools/gen-metrics-and-svgs.py src/Inter-UI-Regular.ufo
|
2018-09-04 01:06:33 +02:00
|
|
|
|
|
|
|
# Download latest Unicode data
|
2018-09-09 21:30:21 +02:00
|
|
|
build/UnicodeData.txt:
|
2018-09-04 01:06:33 +02:00
|
|
|
@echo fetch http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
|
|
|
|
@curl '-#' -o "$@" http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
|
|
|
|
|
|
|
|
|
|
|
|
# install targets
|
2018-09-09 21:30:21 +02:00
|
|
|
install_ttf: all_ttf_const
|
2017-11-27 05:26:15 +01:00
|
|
|
$(MAKE) all_web -j
|
2017-09-19 00:58:34 +02:00
|
|
|
@echo "Installing TTF files locally at ~/Library/Fonts/Inter UI"
|
|
|
|
rm -rf ~/'Library/Fonts/Inter UI'
|
|
|
|
mkdir -p ~/'Library/Fonts/Inter UI'
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -va $(FONTDIR)/const/*.ttf ~/'Library/Fonts/Inter UI'
|
2017-09-23 19:14:17 +02:00
|
|
|
|
|
|
|
install_ttf_hinted: all_ttf
|
2017-11-27 05:26:15 +01:00
|
|
|
$(MAKE) all_web -j
|
2017-09-23 19:14:17 +02:00
|
|
|
@echo "Installing autohinted TTF files locally at ~/Library/Fonts/Inter UI"
|
|
|
|
rm -rf ~/'Library/Fonts/Inter UI'
|
|
|
|
mkdir -p ~/'Library/Fonts/Inter UI'
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -va $(FONTDIR)/const-hinted/*.ttf ~/'Library/Fonts/Inter UI'
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2017-11-27 05:26:15 +01:00
|
|
|
install_otf: all_otf
|
|
|
|
$(MAKE) all_web -j
|
2017-09-19 00:58:34 +02:00
|
|
|
@echo "Installing OTF files locally at ~/Library/Fonts/Inter UI"
|
|
|
|
rm -rf ~/'Library/Fonts/Inter UI'
|
|
|
|
mkdir -p ~/'Library/Fonts/Inter UI'
|
2018-09-09 21:30:21 +02:00
|
|
|
cp -va $(FONTDIR)/const/*.otf ~/'Library/Fonts/Inter UI'
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2017-09-23 21:19:01 +02:00
|
|
|
install: install_otf
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2018-09-04 01:06:33 +02:00
|
|
|
# clean removes generated and built fonts in the build directory
|
2017-08-22 09:05:20 +02:00
|
|
|
clean:
|
2018-09-09 21:30:21 +02:00
|
|
|
rm -rvf build/tmp build/fonts
|
2017-08-22 09:05:20 +02:00
|
|
|
|
2018-09-28 21:58:16 +02:00
|
|
|
.PHONY: all web clean install install_otf install_ttf deploy pre_dist dist geninfo test glyphsync
|