1
1
mirror of https://github.com/rsms/inter.git synced 2024-11-25 18:39:41 +03:00

tooling: adds fontbakery testing

This commit is contained in:
Rasmus Andersson 2021-03-24 12:25:49 -07:00
parent 360f647dfd
commit b4f4ad1aea
2 changed files with 114 additions and 43 deletions

154
Makefile
View File

@ -2,13 +2,15 @@
# make list
#
# High-level make targets:
# text Build all Inter Text fonts (default target)
# display Build all Inter Display fonts
# all Build everything
# all_text Build all Inter (non-dislay) fonts
# all_display Build all Inter Display fonts
# web Build all web fonts
# var Build all variable fonts
# zip Build a complete ZIP archive of all fonts.
# test Build and test everyything
# test Run all test (builds fonts if needed)
# zip Build a complete ZIP archive of all fonts
# zip_text Build a complete ZIP archive of all Inter Text fonts
# zip_display Build a complete ZIP archive of all Inter Display fonts
# install Build and install all OTF files (macOS only)
#
# Style-specific targets:
@ -29,22 +31,21 @@
#
FONTDIR = build/fonts
all: all_text all_display web
default: text
all: text display
# all fonts of given variant
text: all_otf_text all_ttf_text all_ttf_text_hinted all_var_text web_text
display: all_otf_display all_ttf_display all_ttf_display_hinted all_var_display web_display
# all fonts of a certain type
all_otf: all_otf_text all_otf_display
all_ttf: all_ttf_text all_ttf_display all_ttf_text_hinted all_ttf_display_hinted
# all fonts of given variant
all_text: all_otf_text all_ttf_text all_ttf_text_hinted all_var_text web_text
all_display: all_otf_display all_ttf_display all_ttf_display_hinted all_var_display web_display
# web fonts
web: web_text web_display
web_text: all_web_text all_web_hinted_text
web_display: all_web_display all_web_hinted_display
# variable fonts
var: all_var_text all_var_display
var_text: $(FONTDIR)/var/Inter.var.woff2 $(FONTDIR)/var/Inter.var.ttf $(FONTDIR)/var/Inter-V.var.ttf
var_display: $(FONTDIR)/var/InterDisplay.var.woff2 $(FONTDIR)/var/InterDisplay.var.ttf $(FONTDIR)/var/InterDisplay-V.var.ttf
@ -67,7 +68,7 @@ all_var_display: \
$(FONTDIR)/var/InterDisplay-italic.var.ttf \
$(FONTDIR)/var/InterDisplay-italic.var.woff2
.PHONY: all all_otf all_ttf all_text all_display
.PHONY: all all_otf all_ttf text display
.PHONY: web web_text web_display
.PHONY: var var_text var_display all_var_text all_var_display
@ -114,27 +115,33 @@ build/%.woff: build/%.ttf
$(FONTDIR)/var/Inter.var.ttf: $(all_ufo_masters_text) version.txt
@mkdir -p "$(dir $@)"
misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) build/ufo/Inter.designspace
gftools fix-unwanted-tables $@
$(FONTDIR)/var/Inter-V.var.ttf: $(FONTDIR)/var/Inter.var.ttf
misc/fontbuild rename --family "Inter V" -o $@ $<
gftools fix-unwanted-tables $@
$(FONTDIR)/var/Inter-%.var.ttf: build/ufo/Inter-%.designspace $(all_ufo_masters_text) version.txt
@mkdir -p "$(dir $@)"
misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) $<
misc/tools/fix-vf-meta.py $@
gftools fix-unwanted-tables $@
$(FONTDIR)/var/InterDisplay.var.ttf: $(all_ufo_masters_display) version.txt
@mkdir -p "$(dir $@)"
misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) build/ufo/InterDisplay.designspace
gftools fix-unwanted-tables $@
$(FONTDIR)/var/InterDisplay-V.var.ttf: $(FONTDIR)/var/InterDisplay.var.ttf
misc/fontbuild rename --family "Inter Display V" -o $@ $<
gftools fix-unwanted-tables $@
$(FONTDIR)/var/InterDisplay-%.var.ttf: build/ufo/InterDisplay-%.designspace $(all_ufo_masters_display) version.txt
@mkdir -p "$(dir $@)"
misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) $<
misc/tools/fix-vf-meta.py $@
gftools fix-unwanted-tables $@
# OTF/TTF from UFO
@ -211,35 +218,96 @@ $(FONTDIR)/const-hinted/%.ttf: $(FONTDIR)/const/%.ttf
# test runs all tests
# Note: all_check_const is generated by init.sh and runs "fontbuild checkfont"
# on all otf and ttf files.
test: check_all_text check_all_display
misc/fontbuild checkfont $(FONTDIR)/var/*.otf $(FONTDIR)/var/*.woff2
@echo "test: all ok"
test: test_text test_display
test_text: check_text \
build/fbreport-text-const.txt \
build/fbreport-text-var1.txt \
build/fbreport-text-var2.txt
@echo "$(@): OK"
test_display: check_display \
build/fbreport-display-const.txt \
build/fbreport-display-var1.txt \
build/fbreport-display-var2.txt
@echo "$(@): OK"
# FBAKE_ARGS are common args for all fontbakery targets
FBAKE_ARGS := check-universal \
--no-colors \
--no-progress \
--loglevel WARN \
--succinct \
-j \
-x com.google.fonts/check/dsig \
-x com.google.fonts/check/family/win_ascent_and_descent
FBAKE_STATIC_ARGS := $(FBAKE_ARGS) -x com.google.fonts/check/family/underline_thickness
FBAKE_VAR_ARGS := $(FBAKE_ARGS) -x com.google.fonts/check/STAT_strings
# static text family
build/fbreport-text-const.txt: $(wildcard $(FONTDIR)/const/Inter-*.otf)
@echo "fontbakery check-universal Inter-*.otf > $(@) ..."
@fontbakery $(FBAKE_STATIC_ARGS) $^ > $@
@echo "fontbakery check-universal Inter-*.otf OK"
# multi-axis VF text family
build/fbreport-text-var2.txt: $(FONTDIR)/var/Inter.var.ttf
@echo "fontbakery check-universal Inter.var.ttf > $(@) ..."
@fontbakery $(FBAKE_VAR_ARGS) $^ > $@
@echo "fontbakery check-universal Inter.var.ttf"
# single-axis VF text family
build/fbreport-text-var1.txt: $(wildcard $(FONTDIR)/var/Inter-*.var.ttf)
@echo "fontbakery check-universal Inter-*.var.ttf > $(@) ..."
@fontbakery $(FBAKE_VAR_ARGS) $^ > $@
@echo "fontbakery check-universal Inter-*.var.ttf"
# static display family
build/fbreport-display-const.txt: $(wildcard $(FONTDIR)/const/InterDisplay-*.otf)
@echo "fontbakery check-universal InterDisplay-*.otf > $(@) ..."
@fontbakery $(FBAKE_STATIC_ARGS) $^ > $@
@echo "fontbakery check-universal InterDisplay-*.otf"
# multi-axis VF display family
build/fbreport-display-var2.txt: $(FONTDIR)/var/InterDisplay.var.ttf
@echo "fontbakery check-universal InterDisplay.var.ttf > $(@) ..."
@fontbakery $(FBAKE_VAR_ARGS) $^ > $@
@echo "fontbakery check-universal InterDisplay.var.ttf"
# single-axis VF display family
build/fbreport-display-var1.txt: $(wildcard $(FONTDIR)/var/InterDisplay-*.var.ttf)
@echo "fontbakery check-universal InterDisplay-*.var.ttf > $(@) ..."
@fontbakery $(FBAKE_VAR_ARGS) $^ > $@
@echo "fontbakery check-universal InterInterDisplay-*.var.ttf"
x:
echo $(basename build/fbreport-display-var1.json)
# check does the same thing as test, but without any dependency checks, meaning
# it will check whatever font files are already built.
check_text:
misc/fontbuild checkfont \
$(FONTDIR)/const/Inter-*.ttf \
$(FONTDIR)/const/Inter-*.otf \
$(FONTDIR)/const/Inter-*.woff2 \
$(FONTDIR)/var/Inter.var.ttf \
$(FONTDIR)/var/Inter.var.woff2 \
$(FONTDIR)/var/Inter-*.var.ttf \
$(FONTDIR)/var/Inter-*.var.woff2
@echo "check_text: all ok"
check_text: $(wildcard $(FONTDIR)/const/Inter-*.ttf) \
$(wildcard $(FONTDIR)/const/Inter-*.otf) \
$(wildcard $(FONTDIR)/const/Inter-*.woff2) \
$(wildcard $(FONTDIR)/var/Inter-*.var.ttf) \
$(wildcard $(FONTDIR)/var/Inter-*.var.woff2) \
$(FONTDIR)/var/Inter.var.ttf \
$(FONTDIR)/var/Inter.var.woff2
misc/fontbuild checkfont $^
@echo "$(@): OK"
check_display:
misc/fontbuild checkfont \
$(FONTDIR)/const/InterDisplay-*.ttf \
$(FONTDIR)/const/InterDisplay-*.otf \
$(FONTDIR)/const/InterDisplay-*.woff2 \
$(FONTDIR)/var/InterDisplay.var.ttf \
$(FONTDIR)/var/InterDisplay.var.woff2 \
$(FONTDIR)/var/InterDisplay-*.var.ttf \
$(FONTDIR)/var/InterDisplay-*.var.woff2
@echo "check_display: all ok"
check_display: $(wildcard $(FONTDIR)/const/InterDisplay-*.ttf) \
$(wildcard $(FONTDIR)/const/InterDisplay-*.otf) \
$(wildcard $(FONTDIR)/const/InterDisplay-*.woff2) \
$(wildcard $(FONTDIR)/var/InterDisplay-*.var.ttf) \
$(wildcard $(FONTDIR)/var/InterDisplay-*.var.woff2) \
$(FONTDIR)/var/InterDisplay.var.ttf \
$(FONTDIR)/var/InterDisplay.var.woff2
misc/fontbuild checkfont $^ \
@echo "$(@): OK"
.PHONY: test check check_text check_display
.PHONY: test test_text test_display check_text check_display
@ -266,26 +334,26 @@ VERSION := $(shell cat version.txt)
ZIP_FILE_DIST := build/release/Inter-${VERSION}.zip
zip: all
$(MAKE) check_text check_display
$(MAKE) test_text test_display
bash misc/makezip.sh -all -reveal-in-finder \
"build/release/Inter-${VERSION}-$(shell git rev-parse --short=10 HEAD).zip"
zip_text: all_text
$(MAKE) check_text
zip_text: text
$(MAKE) test_text
bash misc/makezip.sh -text -reveal-in-finder \
"build/release/Inter-${VERSION}-text-$(shell git rev-parse --short=10 HEAD).zip"
zip_display: all_display
$(MAKE) check_display
zip_display: display
$(MAKE) test_display
bash misc/makezip.sh -display -reveal-in-finder \
"build/release/Inter-${VERSION}-display-$(shell git rev-parse --short=10 HEAD).zip"
dist_zip: dist_check dist_build
$(MAKE) check_text
$(MAKE) test_text
bash misc/makezip.sh -text -reveal-in-finder "$(ZIP_FILE_DIST)"
dist_build: all_text
dist_build: text
misc/tools/versionize.py
dist_check:

View File

@ -10,3 +10,6 @@ MutatorMath==2.1.2
# for woff2
brotli==1.0.7
# for QA
fontbakery==0.7.34