from Font Name and Font Size ==> TextWidth and Textheight ??
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
hi everybory. I using VC++6.0. if I have font name and font size of text => text height and text width ? hope everybody help for me. thanks very much.
nothing
You can use the GetTextMetrics[^] function to get the font height and width. First get a handle to the font using CreateFont[^] or CreateFontIndirect[^]. Then create a device context using GetDC[^] and select the font into the device context using SelectObject[^]. Now you can use
GetTextMetrics
on the device context handle.«_Superman_» I love work. It gives me something to do between weekends.