Hi Honnesh

See 
https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#instruction-execution-control

Selector flag 3 is the only correct way to control this either in CV program or 
glut. No assumptions should be made otherwise. Everything should be explicit. 
In other words, what you describe is a font bug. which we are not going to 
address.

Alexei


> 
> On Oct 14, 2025, at 15:56, Honnesh Ramachandra <[email protected]> wrote:
> 
> 
> Hello,
>  
> Our automated testing infrastructure flagged an issue with FreeType code 
> where at low font size, certain glyph was scaled incorrectly. The root cause 
> was found to be delay in setting the backward_compatibility flag on the 
> execution context. This issue is sensitive to the order of invocation of 
> FT_Load_Glyph on a set of glyph IDs. If the glyph that depends on the proper 
> value for backward_compatibility is not the first one to be loaded, this 
> issue does not happen because the first glyph load would have set the field 
> value correctly.
>  
> The issue happens when the CV program contains operators that rely on the 
> value of exec->backward_compatibility to determine the adjustment of points.
> 
> Here is a snapshot of one such function in ttinterp.c.
> 
> <image001.png>
>  
> In ttgload.c, there is facility to re-execute the CV program if some of the 
> parameters change since the first execution. Here is a snapshot of that:
> 
> <image002.png>
>  
> The reexecute flag is not currently affected by exec->backward_compatibility 
> flag which, as you can see, can clearly affect the output. My proposal is to 
> include that as well.
> 
> I have attached my version of ttgload.c based off of FreeType version 2.14.1. 
> Please incorporate a similarly effective change. Here is a snapshot of a 
> section of the difference.
> 
> <image003.png>
>  
> The functionality has been refactored out to a function called 
> change_backward_compatibility because of repeated calls to it. I am calling 
> change_backward_compatibility second time because CV program execution may 
> have changed exec->backward_compatibility. I am not sure if CV program can 
> execute such instructions(Ins_IUP, Ins_INSTCTRL, etc.).
> 
> Thanks,
> Honnesh
> <ttgload.c>

Reply via email to