Line Spacing Calculations

Nate Bellowe nathanb at
Sat Aug 27 19:03:37 UTC 2016

Thank you very much, I appreciate this piece of information!

From: Khaled Hosny <khaledhosny at>
Sent: Saturday, August 27, 2016 12:02:22 PM
To: Nate Bellowe
Cc: libreoffice at
Subject: Re: Line Spacing Calculations

On Fri, Aug 26, 2016 at 06:14:09PM +0000, Nate Bellowe wrote:
> - Word is using a different process than we are to calculate the
>   "leading" of a font. We don't parse the font files ourselves,
>   instead rely on libraries to get font sizing information, and
>   perhaps in the "world of font files" I am missing something, and
>   word is parsing the fonts directly and differently.

I have no insight on how Word might be calculating line spacing, but
this would be my first guess. Fonts has 3 different set of parameters
that can affect line height calculations and different applications can
use different parameters:
* sTypoAscender, sTypoDescender, and sTypoLineGap, from OS/2 table[1].
* usWinAscent and usWinDescent, also from OS/2 table.
* Ascender, Ascender and LineGap from hhea table[2].

Ideally applications should use the Typo set, falling back to the hhea
if OS/2 table is missing, but the reality is that many Windows
applications tend to abuse Win set for line spacing, and Mac
applications tend to prefer hhea one.

So for realistic comparison, you need to get the values of those three
sets of parameters and compare Word’s line spacing to them.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list