BLF function blf_str_offset_from_cursor_position returns the character offset in a string given a horizontal cursor position. It currently has no early exits, but can do so for no string or empty string. For negative position values (so left of the string), do not exit out with zero but instead act as if it were zero to ensure we test against the first glyph, which might not be part of the character. Pull Request: https://projects.blender.org/blender/blender/pulls/120673