public uint measureText(
string text,
float width,
bool wordwrap,
float* real_width)
Calculates the byte length which can be included within the specified width.
Parameters
text | The text to get width. |
width | The width of the area to put the text. |
wordwrap | When there are three words of "ABCDE", "FGH", and "IJKL", and the substring until "J" can be included within the width, if wordwrap parameter is false it returns 12, and if wordwrap parameter is true, it returns 10 (the end of the previous word). |
real_width | If this parameter is not null, the real widths of the text is set. An application can set it to null, if it is unnecessary. |
Return
When succeed it returns the byte length which can be included within the specified width in current fontsize, character spacing and word spacing. Otherwise it returns ZERO and error-handler is called.