[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Variable fonts: hhea/typo/win metrics interpreted differe

From: Behdad Esfahbod
Subject: Re: [ft-devel] Variable fonts: hhea/typo/win metrics interpreted differently for instances compared to static fonts?
Date: Tue, 18 Dec 2018 12:53:35 -0500

On Tue, Dec 18, 2018 at 11:43 AM Nikolaus Waxweiler <address@hidden> wrote:
Thanks Alexei for chiming in at

> The following seems to be different: hhea does not seem to be used in VF. Compare and decide which one is correct.

The OpenType spec says nothing variation specific about hhea/typo/win
metrics, except that hhea vmetrics don't seem to be supported by the
`MVAR` in that only win and typo metrics have `MVAR` tags:

The reasoning for that was that varfonts should set OS/2 useTypoMetrics bit on and as such only one set of values need variation.  I would say if that bit is off then the respective MVAR tags should be applied to hhea values.


Regarding ascender, descender and height calculation in sfobjs.c and
ttgxvar.c: the math seems to be the same:

- hhea: ascender 983, descender -217, line gap 0 -> total height 1200 fU
- typo: ascender 739, descender -217, line gap 244 -> total height 1200 fU
- win: ascender 983, descender 217, line gap 0 -> total height 1200 fU

For static fonts, FT uses hhea metrics: `root->height = root->ascender
- root->descender + face->horizontal.Line_Gap;` or `983 - (- 217) + 0
= 1200`
For instances, it uses typo metrics: `root->height = root->ascender -
root->descender + face->os2.sTypoLineGap;` or `739 - (-217) + 244 =

Will look into this deeper later.

Freetype-devel mailing list


reply via email to

[Prev in Thread] Current Thread [Next in Thread]