charIndexAt

The flattened index of the char at a display-space point, or null when the point is on no text line. Within a line, x clamps to the nearest char, which is what a selection drag wants at the line's ends.