From 907fdadf169e1e74d1f2fcae4f37841821200b2e Mon Sep 17 00:00:00 2001 From: jpirnay Date: Sun, 10 May 2026 08:28:16 +0200 Subject: [PATCH] Drop unsupported static=True kwarg from instantiateVariableFont MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instantiateVariableFont() in current fontTools doesn't accept a `static` parameter (signature: varfont, axisLimits, inplace=False, optimize=True, overlap=…, updateFontNames=False, *, downgradeCFF2=False). Calling it with static=True raises TypeError, breaking extract_static_instance() for any sd-fonts.yaml entry that uses the `variable: {wght: …}` form. Drop the unsupported kwarg; keep updateFontNames=True (name table accuracy) and optimize=False (skip wasted gvar work when every axis is fully pinned). The output is still a fully-pinned static instance because all yaml-declared axes are pinned in `axes`. --- lib/EpdFont/scripts/build-sd-fonts.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/EpdFont/scripts/build-sd-fonts.py b/lib/EpdFont/scripts/build-sd-fonts.py index 66890464..2e794e81 100644 --- a/lib/EpdFont/scripts/build-sd-fonts.py +++ b/lib/EpdFont/scripts/build-sd-fonts.py @@ -82,13 +82,11 @@ def extract_static_instance(source_path: Path, axes: dict, family_name: str, sty print(f" Extracting static instance: {family_name}/{style_name} ({axis_key})") font = TTFont(str(source_path)) - font = instantiateVariableFont( - font, - axes, - static=True, - updateFontNames=True, - optimize=False, - ) + # `static` was removed (or never existed) in current fontTools; it raises + # TypeError under recent releases. updateFontNames=True keeps the saved + # name table accurate; optimize=False skips a gvar pass that's wasted + # when every axis is fully pinned. + font = instantiateVariableFont(font, axes, updateFontNames=True, optimize=False) font.save(str(cached)) font.close()