pub unsafe extern "C-unwind" fn CTLineGetStringIndexForPosition(
line: &CTLine,
position: CGPoint,
) -> CFIndexAvailable on crate feature
CTLine only.Expand description
Performs hit testing.
This function can be used to determine the string index for a mouse click or other event. This string index corresponds to the character before which the next character should be inserted. This determination is made by analyzing the string from which a typesetter was created and the corresponding glyphs as embodied by a particular line.
Parameter line: The line being examined.
Parameter position: The location of the mouse click relative to the line’s origin.
Returns: The string index for the position. Relative to the line’s string range, this value will be no less than the first string index and no greater than one plus the last string index. In the event of failure, this function will return kCFNotFound.