The byte offset in string_to_measure of the grapheme boundary nearest to horizontal position x.
- text: the text system holding the fonts.
- string_to_measure: the UTF-8 text.
- style: the font and size the text is drawn with.
- x: the position in points from the start of the text. Zero or less gives 0.
index_at_x :: (
text: *Text_System,
string_to_measure: string,
style: Text_Style,
x: float
) -> int
The byte offset in string_to_measure of the grapheme boundary nearest to horizontal position x.
Parameters
- text: *Text_System
- the text system holding the fonts.
- string_to_measure: string
- the UTF-8 text.
- style: Text_Style
- the font and size the text is drawn with.
- x: float
- the position in points from the start of the text. Zero or less gives 0.
Returns
- int