[HarfBuzz] font_get_h_extents & font_get_v_extents

kelvinsthirteen at gmail.com kelvinsthirteen at gmail.com
Mon Jun 27 13:17:11 UTC 2016



> On Jun 27, 2016, at 6:53 AM, Khaled Hosny <khaledhosny at eglug.org> wrote:
> 
>> On Sun, Jun 26, 2016 at 11:11:11PM -0400, kelvinsthirteen at gmail.com wrote:
>> 
>> 
>>>> On Jun 26, 2016, at 10:25 PM, Khaled Hosny <khaledhosny at eglug.org> wrote:
>>>> 
>>>> On Sun, Jun 26, 2016 at 10:05:15PM -0400, Kelvin Ma wrote:
>>>> How do you get the plain ascent and descent of a font? font_get_h_extents()
>>>> gives the HHead values of the font, not the regular ascent and descent.
>>> 
>>> There are three different settings for ascent and descent in OpenType
>>> fonts, which one you are after?
>> 
>> The ones that partition the EM square. The ascent and descent should add up to the UPEM value.
> 
> I don’t know if there is such a thing, but it would be pretty useless
> for many fonts as there should be no relation between EM size and
> vertical metrics.

It is useful for aligning lines of text and setting the leading. When the em square partition is used, leading = fontsize * line spacing. Very important when pixel alignment comes into play.


More information about the HarfBuzz mailing list