2014-12-04
10:31 AM
- last edited on
2023-05-23
04:38 PM
by
Rubia Torres
2014-12-05 10:11 AM
double DetermineTextWidth (const char* str, short font, double size)
{
if (strlen (str) == 0)
return (0);
API_TextLinePars tlp;
double width = 0.0;
BNZeroMemory (&tlp, sizeof (API_TextLinePars));
tlp.drvScaleCorr = true; // Apply drawing scale...
tlp.index = 0; // Get the length of the longest line (there may be only one line...)
tlp.lineStr = const_cast<char*> (str);
tlp.wFace = APIFace_Plain;
tlp.wFont = font;
tlp.wSize = size;
tlp.wSlant = PI / 2.0; // Plain text
ACAPI_Goodies (APIAny_GetTextLineLengthID, &tlp, &width);
return (width);
} 2014-12-08 07:20 AM