result = WinXDraw_GetTextWidth (hFont, STRING text, maxWidth)
Gets the width of a string of text, or alternatively, the number of characters that will fit into a certain space
Parameter | Description |
---|---|
hFont | The handle to the font the text will be drawn with |
STRING text | The string to test |
maxWidth | The maximum width for the string |
If the width of the string is < maxWidth, the return value is the width of the string in pixels. If the width of the string > maxWidth the return value is -1*the number of characters that fit in the available space.
The height of the text is specified by the font. Because variable pitch fonts have variable character widths and kerning pairs you need this function to calculate the width of a string.
'how wide is a string? |