I’m adding SVG export support to an old application built with MFC and using plain old GDI. As SVG 1.1 doesn’t support text wrapping, I am forced to do this manually.
The application provides me with a CFont instance (which contains an HFONT). I can calculate the width of a piece of text using CFont::GetTextExtentPoint(), but I haven’t found out how to obtain the line height of a font yet.
How can I obtain the line height of my font?
Or does CFont::GetTextExtentPoint() always return the line height in the Y coordinate (instead the actual height of the text’s tight-fitting bounding box)?
I think I have a possible answer:
It’s a bit cumbersome, so if there’s a shorter, more obvious solution (or if anyone can confirm that
CFont::GetTextExtentPoint()provides me with the actual line height), I’d be happy to hear it still 😉