Converts from x and y position within a layout to the byte index to the
character at that logical position. If the y position is not inside the
layout, the closest position is chosen (the position will be clamped inside
the layout). If the X position is not within the layout, then the start
or the end of the line is chosen as describe for x_to_index(). If either
the x or y positions were not inside the layout, then returns 0.
Returns:
([ "index": byte index, "trailing": where in grapheme user clicked ]).