Commit Graph
11 Commits
Author SHA1 Message Date
jpirnay 461a277925 Use upstream variant to get in sync 2026-05-11 13:05:43 +02:00
jpirnay ad52abf069 Close source TTFont after instantiateVariableFont rebind
instantiateVariableFont with default inplace=False returns a *new*
TTFont; rebinding `font` strands the source TTFont and its file handle
open until GC. The trailing font.close() then closes only the new
pinned-instance object.

Capture the source as a separate reference and close both with nested
try/finally: inner finally closes the static instance after save (or
on save failure), outer finally closes the source unconditionally.
2026-05-10 10:35:51 +02:00
jpirnay 907fdadf16 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`.
2026-05-10 08:28:16 +02:00
jpirnay 104af74079 Additional glyphs 2026-05-07 08:31:22 +02:00
jpirnay 3254582a20 Extend script functionality 2026-05-07 08:23:51 +02:00
jpirnay f15b1d06bf Fix static font generation from variable fonts 2026-05-05 17:35:13 +02:00
jpirnay 3bd18d855d Amend fonts 2026-05-03 23:40:45 +02:00
jpirnay 5617db3ad2 Fix font-location 2026-05-03 22:42:54 +02:00
jpirnayandCopilot cc9ff5bae9 More review changes
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 18:42:45 +02:00
jpirnayandCopilot a5469c0bb9 Review comments
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 17:22:10 +02:00
jpirnay df94ccaa86 Recover from merge fiasco 2026-05-02 16:54:31 +02:00