On Tue, Sep 19, 2017, 07:25 Nicolas Jinchereau <[email protected]>
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.)
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to