Re: Leading Pango Metrics



Hi,
 
From: Owen Taylor <otaylor redhat com>
Date: 2016-01-29 20:44 GMT+01:00
Subject: Re: Leading Pango Metrics
To: Alex Vazquez <avazquez dev gmail com>, gtk-i18n-list gnome org

On Thu, 2016-01-28 at 13:25 +0100, Alex Vazquez wrote:
> Hi! I have a question about get metrics of a font.
> If I don't understand wrong the height of a font is
> ascent+descent+leading.
> with pango I can get ascent and descent but i can't get the leading.
> I try calculate the leading with  pango_layout_get_spacing() but this
> value get me 0.
> Also I try get leading with pango_layout_get_pixel_size() but the
> result is ascent + descent.
> I'm using as a font "Purisa"
> Can i calculate the leading of a font using pango ? 

"leading" isn't a property of a font, but rather of how it's used - and
does corresponding to pango_layout_get_spacing().

But fonts can actually carry information about suggested leading (line gap). This is available in the "OS/2" and "hhea" TrueType tables (see: https://fontforge.github.io/fontinfo.html#TTF-Metrics).

Can't this metric be retrieved via Pango ?

Best,

Guillermo Rodriguez Garcia
guille rodriguez gmail com


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