Caret position in points at a UTF-8 byte boundary, including the pair adjustment to the next glyph. Use the whole line so a caret before V in AV sits where V is drawn, rather than at the unkerned A advance.
Signature
text_offset_x :: (
text: *Text_System,
line: string,
offset: int,
style: Text_Style
) -> float
ui := headless();
defer free_ui(*ui);
assert(text_offset_x(*ui.text, "abc", 2, .{ size = 10 }) == 12);