Win32 DrawText line height

gdi+text;winapi

I'm calling the Win32 DrawText function to output some text into a device context. The text is long and wraps nicely onto a second line. The problem is I need to decrease the space between lines a bit (I guess decrease the line height?). Any ideas on how to do this?

I would just call DrawText twice (one for each line) but then I have to do my own word wrap.

Is there any other way?

Thanks

Best Answer

One possibility is to put the text into a disabled Rich Edit Control. I think that gives you a lot of control over formatting.

If you do write your own word wrap, you probably want to use GetTextExtentExPoint() for measuring how much will fit in each line.

Related Topic