From 4b0a83471561864120406d19afe62b2fb67441a4 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Mon, 13 Nov 2023 12:15:19 -0800 Subject: [PATCH] improvements to autohint with independent reference fonts for italic styles --- Makefile | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 4db40ec62..dcd1c9333 100644 --- a/Makefile +++ b/Makefile @@ -170,19 +170,36 @@ $(FONTDIR)/static/%.ttf: $(UFODIR)/%.ufo build/features_data | $(FONTDIR)/static . $(VENV) ; fontmake -u $< -o ttf --output-path $@ $(FM_ARGS_2) -$(FONTDIR)/static-hinted/InterDisplay-%.ttf: $(FONTDIR)/static/InterDisplay-%.ttf | $(FONTDIR)/static/InterDisplay-Regular.ttf $(FONTDIR)/static-hinted venv - . $(VENV) ; python -m ttfautohint \ - --stem-width-mode=qqq \ - --reference $(FONTDIR)/static/InterDisplay-Regular.ttf \ - --no-info \ - "$<" "$@" +AUTOHINT_ARGS := --stem-width-mode=qqq --no-info + +$(FONTDIR)/static-hinted/Inter-Regular.ttf: $(FONTDIR)/static/Inter-Regular.ttf | $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) "$<" "$@" + +$(FONTDIR)/static-hinted/InterDisplay-Regular.ttf: $(FONTDIR)/static/InterDisplay-Regular.ttf | $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) "$<" "$@" + +$(FONTDIR)/static-hinted/Inter-Italic.ttf: $(FONTDIR)/static/Inter-Italic.ttf | $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) "$<" "$@" + +$(FONTDIR)/static-hinted/InterDisplay-Italic.ttf: $(FONTDIR)/static/InterDisplay-Italic.ttf $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) "$<" "$@" + +$(FONTDIR)/static-hinted/InterDisplay-%Italic.ttf: $(FONTDIR)/static/InterDisplay%Italic.ttf | $(FONTDIR)/static-hinted/InterDisplay-Italic.ttf $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) \ + --reference $(FONTDIR)/static-hinted/InterDisplay-Italic.ttf "$<" "$@" + +$(FONTDIR)/static-hinted/InterDisplay-%.ttf: $(FONTDIR)/static/InterDisplay-%.ttf | $(FONTDIR)/static-hinted/InterDisplay-Regular.ttf $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) \ + --reference $(FONTDIR)/static-hinted/InterDisplay-Regular.ttf "$<" "$@" + +$(FONTDIR)/static-hinted/Inter-%Italic.ttf: $(FONTDIR)/static/Inter-%Italic.ttf | $(FONTDIR)/static-hinted/Inter-Italic.ttf $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) \ + --reference $(FONTDIR)/static-hinted/Inter-Italic.ttf "$<" "$@" + +$(FONTDIR)/static-hinted/Inter-%.ttf: $(FONTDIR)/static/Inter-%.ttf | $(FONTDIR)/static-hinted/Inter-Regular.ttf $(FONTDIR)/static-hinted venv + . $(VENV) ; python -m ttfautohint $(AUTOHINT_ARGS) \ + --reference $(FONTDIR)/static-hinted/Inter-Regular.ttf "$<" "$@" -$(FONTDIR)/static-hinted/Inter-%.ttf: $(FONTDIR)/static/Inter-%.ttf | $(FONTDIR)/static/Inter-Regular.ttf $(FONTDIR)/static-hinted venv - . $(VENV) ; python -m ttfautohint \ - --stem-width-mode=qqq \ - --reference $(FONTDIR)/static/Inter-Regular.ttf \ - --no-info \ - "$<" "$@" $(FONTDIR)/var/.%.var.ttf: $(UFODIR)/%.var.designspace build/features_data | $(FONTDIR)/var venv . $(VENV) ; fontmake -o variable -m $< --output-path $@ $(FM_ARGS_2)