SizeF GetHtmlTextExtent(const char* putf8Str, float width = 0, const TextParams* ptxtParams = NULL); SizeF GetHtmlTextExtent(const wchar_t* pwstr, float width = 0, const TextParams* ptxtParams = NULL); SizeF GetHtmlTextExtent(const String& str, float width = 0, const TextParams* ptxtParams = NULL);
GetHtmlTextExtent returns size of the text rectangle that would be necessary to render the specified HTML text. If 'width' contains positive value then it assumes word wrapping is on and only the height will be calculated. HTML is treated as multi-line text.
Here the ptxtParams parameter works as a set of default text parameters, so all styles from parsed HTML virtually will be applied above the styles from the ptxtParams.
Parameters |
Description |
const char* putf8Str |
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 |
Null-terminated Unicode/UCS-2 string. |
const String& str |
Size of the text rectangle.