ÿþThe way to do it is to first go to 
ttinterp.c , then at the start of the 
file declare two variables:



       char FT_injectedGETINFOhack = 0;

       FT_Long 
FT_injectedGETINFOhackvalue;



Now here's the tricky part. Go near 
line 7660 and find the ending of the 
GETINFO function. It would look 
something like this:



#endif /* 
TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY 
*/



    args[0] = K;

  }



So the way to add the intercept is to 
then proceed to add code to overwrite 
the value:



#endif /* 
TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY 
*/



    if(FT_injectedGETINFOhack){

       K = FT_injectedGETINFOhackvalue;

    }

    args[0] = K;

  }







What will provide in it better render 
result? Of course, this makes the 
GETINFO customizable for users of 
FreeType (that include the FreeType 
files in their programs). The benefits 
of interception can be seen for 
instance in the v38 renderer.



Disclaimer: The sample images are made 
with v38 FreeType bytecode, but the 
outlines are not rasterized with 
FreeType rasterizer. The correct gasp 
setting for symmetric smoothing is used 
in the renders, with 6×1 or 6×5 
oversampling and the subpixel box 
filter to simulate ClearType.



First of all, a commercial font is 
rendered like this when GETINFO is not 
intercepted: 
https://i.imgur.com/W9FSEzd.png



Size 18ppem and up is where it gets 
very controversial in rendering. In 
this case what default v38 FreeType 
does is end up with fractional 
horizontal stems. Using Visual TrueType 
reveals that the font only does that 
when fractional widths are used in 
ClearType. However it is very worrying 
that this is default FreeType behavior, 
and no FT_RENDER_MODE_XXX is documented 
to use an integer width version of 
subpixel hinting.



What happens with the intercepted 
GETINFO? In the following image I use 
the following settings: 

              FT_injectedGETINFOhack = 1;

              FT_injectedGETINFOhackvalue = 
0x00006C00;

https://i.imgur.com/PuhGJ13.png . 
Suddenly the problems with fractional 
horizontal stems disappear. This will 
in fact allow the FreeType user to use 
a custom GETINFO value, and GETINFO 
(what fonts see how the renderer is 
like) becomes detached from the 
FreeType render mode (what the renderer 
is actually like), allowing for 
personalized renderer settings. 
However, even when the GETINFO is 
changed the v38 or v40 renderer is 
still miles from being finished, 
especially considering that FreeType 
does not even directly have a proper 
rasterizer for the base form of 
subpixel hinting.

Reply via email to