Package: pango

Function pango:glyph-string-x-to-index

Lambda List

pango:glyph-string-x-to-index (glyphs text len analysis xpos)

Syntax

(pango:glyph-string-x-to-index glyphs text len analysis xpos) => index, trailing

Arguments

glyphs -- a pango:glyph-string instance
text -- a string for the text of the run
len -- an integer for the number of bytes in text
analysis -- a pango:analysis instance for the analysis information from the pango:itemize function
xpos -- an integer for the x offset (in Pango units)
index -- an integer for the byte index within text
trailing -- a boolean whether the position is on the leading or trailing edge of the character

Details

Convert from x offset to character position. Character positions are computed by dividing up each cluster into equal portions. In scripts where positioning within a cluster is not allowed (such as Thai), the returned value may not be a valid cursor position. The caller must combine the result with the logical attributes for the text to compute the valid cursor position.
 

See also

2026-03-08