Export variable font via instance.generate

It’s seem that font format “VARIABLE” is not support with instance.generate.

KeyError: "The container format is not supported: VARIABLE (only 'WOFF' 'WOFF2' 'plain' and 'EOT')"

There is a way to export VF from this function ?

because the variable font is a container for many instances, you call export on the GSFont object rather than the GSInstance.

the format is where you want to call it VARIABLE, not the container. the containers are the kind of font binary you are generating for a given format (PLAIN, which is a TTF, or WOFF, or WOFF2).

try:

vf_containers = [PLAIN,WOFF2]
Glyphs.font.export(FontPath="~/Desktop", Format=VARIABLE, Containers=vf_containers, AutoHint=True)
2 Likes