Get required size of text object from font
Get required size of text object from font
Is there a way to get the minimum required height (in page units, twips I think) for a Text object, given a font?
Hello,
The situation you have described is typically resolved by using the windows API call GetTextExtentPoint32.
I have included a code snippet below.
int len = strlen( lpszText );
GetTextExtentPoint32(dc, lpszText, len , &szTextSize);
*plXpos = PixelsToTwips(szTextSize.cx ,0 );
*plYpos = PixelsToTwips(szTextSize.cy ,1 );
Hope this helps?
The situation you have described is typically resolved by using the windows API call GetTextExtentPoint32.
I have included a code snippet below.
int len = strlen( lpszText );
GetTextExtentPoint32(dc, lpszText, len , &szTextSize);
*plXpos = PixelsToTwips(szTextSize.cx ,0 );
*plYpos = PixelsToTwips(szTextSize.cy ,1 );
Hope this helps?