[HarfBuzz] How to perform full precision shaping (with no scaling and grid fitting)
philodej at gmail.com
Fri Apr 20 06:16:14 PDT 2012
I am trying to perform a shaping which is independent on a resulting
device, so no scaling, no grid-fitting is desired.
In order to disable the grid-fitting and get as high precision as possible
I thought it was sufficient to work in the font design precision - to scale
the font to some very high value (like the *UpEm* value), i.e. using the
* hb_face_t* const face( hb_ft_face_create( ft_face, NULL ) );*
* hb_font_t* font = hb_font_create( face );*
* unsigned int const upem( hb_face_get_upem (face) );*
* hb_font_set_scale( font, upem, upem );*
*hb_ft_font_set_funcs( font );*
But unfortunately it is not enough. The
*hb_ft_get_glyph_h_kerning()*function calls the
*FT_Get_Kerning* with kerning mode set to *FT_KERNING_DEFAULT*, and for
example for *Arial font* and *'T'* and *'a'* character pair (55 and 68
glyph indices) it returns value -256 (instead of correct value -227). It if
the scaling seems correct the function still performs some fitting. If i
try to change the kerning mode to FT_KERNING_UNSCALED then I get the
correct value (-227) but that is probably not a proper fix but just a hack.
Is there an elegant and efficient way to disable both scaling and fitting
and perform a device independent full precision shaping?
Thank you very much.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the HarfBuzz