SizeF GetTextExtent(const char* putf8Str, float width = 0, const TextParams* ptxtParams = NULL); SizeF GetTextExtent(const wchar_t* pwstr, float width = 0, const TextParams* ptxtParams = NULL); SizeF GetTextExtent(const String& str, float width = 0, const TextParams* ptxtParams = NULL);
GetTextExtent returns the size of the text rectangle that would be necessary to render the specified text using the text parameters from the ptxtParams parameter. If WordWrap and Multiline in ptxtParams are set to 'true' then it uses 'width' parameter as the width and calculates the height.
Parameters |
Description |
const char* putf8Str |
Pointer to null-terminated UTF-8 string. |
float width = 0 |
Desired width of the text rectangle. |
const TextParams* ptxtParams = NULL |
Pointer to the text parameters. |
const wchar_t* pwstr |
Pointer to null-terminated Unicode/UCS-2 string. |
const String& str |
Size of the text rectangle.