Question about Variable font export

It’s possible to export variable font without having the addition of cubic node?

I’m trying to write a Drawbot script to export weight animation with the handles and points displayed.
With static export, no points are added but with variable font, the cubic point appears.

firstImage

Variable fonts are always written with TrueType curves. This already leads to extra nodes (mostly off curve). But converting that back to cubic will most likely add more points. I would write the drawBot Script to run directly in Glyphs, so you can access the outlines directly.

Yeah, that’s what I expected eurf…
I tried to do it in Drawbot because I thought that it would be easier to use axis with an variable font export instead of use interpolation with the Glyphs API

I tried to write a script to run directly it from drawBot plugin in Glyphs3.
I pick a small code that I found on the forum.

from GlyphsApp import *
import objc

myFont = Glyphs.font

instance = GSInstance()
instance.setFont_(myFont)

axe1Value = 1
while axe1Value < 100 :
    newPage(1000,1000)
    axe1Value += 5
    instance.axes[1] = axe1Value
    instanceFont = instance.interpolatedFontProxy
    instanceGlyph = instanceFont.glyphs["B"]
    instanceLayer = instanceGlyph.layers[instanceFont.fontMasterID()]
    drawPath(instanceLayer.bezierPath)
    print(axe1Value)

    
saveImage("~/Desktop/B.gif")

For a reason that I don’t know, for every step in the loop, the process takes more and more time for each loop. I don’t know what causes this progressive slowdown in the script.
Am I doing something wrong ?

The script runes in under a second for me. can you send me the font you are using for this?

I tried to just copy the “B” in a New Font with two masters and it runes in under a second for me too.

I tried to launch it with two other font projects that I have with multiple masters and axes, and the result is the same, each loop is longer than the precedent.

B TEST.glyphspackage.zip (41.2 KB)

EDIT :

  • With multiple axes font , if I move out of the loop the value set for the others axes, the script run really faster.

  • I don’t know why but the view does not refresh instantly in drawbot while the script is finished (I see it because the saveImage appear in my desktop)

I found what cause this slowndown !
When I remove all Instances in “Export” Panel, the script runes under a second.
The more instances there are in the export panel, the more important the slowdown is.

How many instances did you have?

In this font, 35.
But even if only one Instance is present in the “Export” Panel, the script slowdown.

Can you send me that font (send a link in a private message in the forum)?

Done

I had a look at your file. It has not so much to do with the count of the instances bit with the count of open tabs. Close most of them and it will be much quicker.

I improved it so that open tabs will not influence the performance.

But the best “fix” is to put the code between myFont.disableUpdateInterface() and myFont.enableFutureUpdates() calls. That makes the script run in 5 ms for me.

1 Like

“Variable fonts are always written with TrueType curves.”

Fontmake and FontLab 7 both produce Variable Fonts with PostScript curves.

We will add support for this.

Hi Georg, is the support for Variable Fonts with PostScript curves in the near future possible?

Not in the near future (next couple month).

1 Like