TrueType Stack
Change the maxStackElements value in the maxp table of a TrueType font.
Glyphs versions before 3.2 always set the maximum number of stack elements to 100. When you have many delta instructions on zones, this number may need to be increased to avoid a stack overflow in the TrueType interpreter.
Whether your hinting will hit this limit is not detected automatically. You will only see that your alignment zones look broken when you preview the fonts in Windows. It depends on the ppm size in which deltas are set, and the number of deltas.
Each delta for a certain ppm range needs two numbers on the stack, so if you have more than 49 zone deltas between 9 and 24 ppm, or between 25 and 31 ppm, or between 32 and 48 ppm, you will hit the limit of 100 values on the stack. You can check in a ttx dump of the exported font whether there is an NPUSHB
instruction with more than 100 arguments in the prep table.
The required maximum stack depth value is not calculated automatically either, but you could just set it to a high enough number to avoid any problems.
Parameter
de.kutilek.corretto.maxp.stack
Format
max_stack_elements
A number indicating the maximum number of elements on the stack that may occur while TrueType instructions are executed.
Example
{
customParameters = (
{
name = de.kutilek.corretto.maxp.stack;
value = "255";
}
);
}
Explanation: Set the maximum stack depth parameter in the maxp table to 255.