Drop unsupported static=True kwarg from instantiateVariableFont
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`.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user