October 9, 2021, 12:31pm
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.
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.
October 9, 2021, 12:59pm
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
October 9, 2021, 7:07pm
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 *
myFont = Glyphs.font
instance = GSInstance()
axe1Value = 1
while axe1Value < 100 :
axe1Value += 5
instance.axes = axe1Value
instanceFont = instance.interpolatedFontProxy
instanceGlyph = instanceFont.glyphs["B"]
instanceLayer = instanceGlyph.layers[instanceFont.fontMasterID()]
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?
October 10, 2021, 6:40am
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)
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)
October 10, 2021, 8:28am
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?
October 10, 2021, 8:41am
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)?
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.enableFutureUpdates() calls. That makes the script run in 5 ms for me.
“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.