[HarfBuzz] Units of members of hb_glyph_position_t

Eli Zaretskii eliz at gnu.org
Tue May 28 02:48:08 UTC 2019


> From: Behdad Esfahbod <behdad at behdad.org>
> Date: Mon, 27 May 2019 21:21:10 -0400
> Cc: "harfbuzz at lists.freedesktop.org" <harfbuzz at lists.freedesktop.org>
> 
>  control those units (if they are under the client program's control).
> 
> They are controlled mainly using hb_font_set_scale().

What happens if hb_font_set_scale is not called?  Is there some kind
of default?

>  In particular, I get a huge value of x_advance for the letter U+05EA
>  HEBREW LETTER TAV when it is followed by U+05BB HEBREW POINT QUBUTS.
>  The value of x_advance I get is 1229, which is too large even after
>  dividing by 64 (which, btw, I still am not sure is TRT in my case,
> 
> FreeType works in 26.6 fixed-point, ie. 64 units per 1.0.  That's where the 64 value comes from.  And you
> don't see it in your code because hb_ft_font_create* sets that on hb_font for you.

hb_ft_font_create is not used in the Windows code, because the Windows
code doesn't use Freetype to open and otherwise manipulate fonts.

> In your Windows code, you should call hb_font_set_scale().  I believe right now you are *not* calling, and you
> get values in the face's UPEM.  That's the default scale for fonts.  You can get the face UPEM using
> hb_face_get_upem(). 

OK, thanks, I will look into this.


More information about the HarfBuzz mailing list