Draw character aligned vertically

Hi,

I want to draw a character exactly in the middle of some space, aligned vertically, considering not the font height, but the height of that specific character. (because for instance an underscore ‘_’ has a different height and y offset than an asterix ‘*’).

Any ideas?

Best,
Jelle

You can retrieve the outline of a specific glyph by calling Typeface::getOutlineForGlyph. You can then find the axis-aligned bounding-box and its centre very easily.

1 Like