freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Correct way to calculate line gap/external leading


From: Jjgod Jiang
Subject: [ft-devel] Correct way to calculate line gap/external leading
Date: Tue, 12 Apr 2011 23:18:22 +0200

Hi,

I can't find in FreeType's docs on how to calculate the line gap,
currently we are using:

    FT_Size_Metrics metrics = face->size->metrics;
    leading = (metrics.height - metrics.ascender + metrics.descender) >> 64;

but sometimes I get -1 as the leading (Lucida Grande from Mac OS X, Ubuntu
fonts, Inconsolata, DejaVu Sans). Is it fine to have negative leading? or
is there anything wrong with my code? Thanks.

Attached my code to test.

- Jiang

Attachment: main.c
Description: Text Data


reply via email to

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