I'm trying to render a simple editable textbox and I'm struggling to vertically position the text rendered with freetype.
I've first tried obtaining the character in the typed string with the largest bitmap_top value, and then render everything relative to that, that works and correctly aligns the text, but it results in text that shifts up and down as the user types and larger characters come and go.
Next I tried simply offsetting the vertical position of the text with the global font metric height minus the bitmap_top value. This also worked well and solved the issue of text jumping up and down, but it resulted in an unnecessary gap above all the text, and all characters that went below the origin being rendered outside the text box.
Is there a standardized way for ensuring that all text rendered with freetype does so along a global baseline for the font and font size? and then, given this global baseline and a rectangular region, work out how to print the text centered to the region?
Thanks,