freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] glyph metrics don't match bitmap size (2.8.1)


From: Jan Alexander Steffens
Subject: Re: [ft-devel] glyph metrics don't match bitmap size (2.8.1)
Date: Tue, 19 Sep 2017 05:45:25 +0000



On Tue, Sep 19, 2017, 07:25 Nicolas Jinchereau <address@hidden> wrote:
Thanks for the quick responses.

I've managed to render text correctly now using LCD filtering (the new 2.8.1 version). I was able to do it by ignoring the glyph metrics and using the bitmap size itself. This works well enough for now, and the text looks great, but I would like to be able to retrieve final dimensions of the bitmap without actually rendering/allocating anything, so I can calculate the layout of a bitmap-font/texture-atlas, and blit the glyphs afterward. I've been doing this for while and only ran into a problem when I tried the new LCD filtering.

I understand why the padding would be needed, but why wouldn't it be included in the glyph metrics (width/height)?

Because the layout shouldn't change just because the glyphs got blurred. The bitmap_left and bitmap_top fields will tell you the offset of the bitmap from the pen position on the baseline. (The pen position is adjusted by the advance width of each glyph after drawing it, usually further modified by kerning from layers above FreeType.)

reply via email to

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