Closed psb1558 closed 4 years ago
I'll answer my own query, since I figured it out this morning after some two days of struggle. Got the answer by trying the font out in Axis-Praxis with the console open, so saw the report from OTSanitiser that maxSizeOfInstructions in maxp was too small. In fact, I wasn't setting MaxSizeOfInstructions at all, so whatever value was already stored in the font was being retained. The difference between a variable font and a static one was simply that fontmake was running ttfautohint on the static font but not on the variable one, so MaxSizeOfInstructions in the static font was quite large, while in the variable font it was zero.
One can track the size of the instructions with len(glyph.program.getBytecode()).
And now I'll close this to spare myself embarrassment for missing something so obvious.
I've posted about this on the fontTools list but will also put it here, in case some good soul wandering in these parts should happen to have an answer. I've been trying to write a script that will merge TT instructions into a variable font, but while the resulting font looks correct when examined via ttx, OTMaster or elsewhere, the instructions don't get executed, and in OTMaster the glyph doesn't display, but instead a red frowny face:
which expresses my mood just now. I've tried paring down the script to do nothing but push and pop values, but the effect is the same. But here's the thing: the very same script, run on a static instance of Elstob, works fine. If there are real instructions in it, they get executed without difficulty.
So what I am doing wrong, or how do instructions for a variable font have to be handled differently from a static font?
Here's the minimal code (which does nothing):