Closed chrisridd closed 2 years ago
After the patch in #26 this is what I get:
Looks better now for me as well. Thank you for your contribution!
Thanks! And it looks like moving a variable declaration down broke on an older compiler - apologies for that.
I tried to draw a single line of text in multiple fonts, aligned at the baseline. The results are not great, using 40pt text just to make it a bit more obvious:
The red line is my baseline. I'm doing:
NVDI 5 does get the vertical alignment correct.
The
ft2_text_render()
assembles the character bitmaps into a bigger buffer and blits it to the screen using a vertical offset fromextra.distance
. The computation of theextra.distance
fields seems to be OK, but the more I read about metrics and sizes at freetype.org the less I feel I know! Is the bbox the right way to measure things, or just the ascent+descent?The errors are reasonably significant (up to 16 pixels in my screenshot!), so they can't be just simple rounding errors.