Method GetLengthThatFits
GetLengthThatFits(string, int, int, TextDirection)
Gets the number of the Runes in the text that will fit in width.
public static int GetLengthThatFits(string text, int width, int tabWidth = 0, TextDirection textDirection = TextDirection.LeftRight_TopBottom)
Parameters
textstringThe text.
widthintThe width.
tabWidthintThe width used for a tab.
textDirectionTextDirectionThe text direction.
Returns
- int
The index of the text that fit the width.
Remarks
This API will return incorrect results if the text includes glyphs whose width is dependent on surrounding glyphs (e.g. Arabic).