> So after some additional discussions with Werner, I came up with the
> following patch, which speeds up FT_New_Face for Arial and Times by
> huge 18% and 27% respectively.

Thanks, we are getting nearer :-) The patch is not correct yet,
however.

>      {
>        /* non-square pixels, use the stretched routines */
> +      CUR.func_cur_ppem  = Current_Ppem_Stretched;
>        CUR.func_read_cvt  = Read_CVT_Stretched;
>        CUR.func_write_cvt = Write_CVT_Stretched;
>        CUR.func_move_cvt  = Move_CVT_Stretched;
> @@ -8283,6 +8288,7 @@
>      else
>      {
>        /* square pixels, use normal routines */
> +      CUR.func_cur_ppem  = Current_Ppem;
>        CUR.func_read_cvt  = Read_CVT;
>        CUR.func_write_cvt = Write_CVT;
>        CUR.func_move_cvt  = Move_CVT;

Contrary to CVT values, which are computed before a glyph's bytecode
program gets executed, the ppem value is dependent on the projection
vector, which can be modified *by the bytecode itself*, namely by
SPVTCA and friends.  In other words, you have to set `func_cur_ppem'
in `Compute_Funcs' and not `TT_RunIns'.

In most cases, the projection vector is either set to (1,0) or (0,1)
to handle horizontal and vertical hinting, respectively.  For diagonal
lines it might be set to a different value, but this is rare compared
to the two special cases.


    Werner

_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to