PistonDevelopers / gfx_text

Draw text for gfx using freetype
http://docs.piston.rs/gfx_text/gfx_text/
MIT License
22 stars 12 forks source link

Fix measuring text height #69

Closed marek-g closed 6 years ago

marek-g commented 6 years ago

This is a change that was already mentioned as "todo" in measure function's comment. Height returned from measure() function is always font's height in pixel.

It's taken from font size metrics so it gives better result than suggested max of all glyphs height as it also includes nice bottom margin (similar to top margin from bitmap_top). Drawing box from returned values gives a nice rounding box.

Kagami commented 6 years ago

Thanks!

marek-g commented 6 years ago

That was quick! Thank you too. Your text library fits the best my needs :)

Marek

On Mon, Mar 12, 2018 at 8:11 PM, Kagami Hiiragi notifications@github.com wrote:

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PistonDevelopers/gfx_text/pull/69#issuecomment-372429338, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1WAum_arC3WeRMT36KN1abLDK9GeOqks5tdshwgaJpZM4SnNe_ .