Package: pango

Function pango:layout-index-to-pos

Lambda List

pango:layout-index-to-pos (layout index)

Syntax

(pango:layout-index-to-pos layout index) => x, y, width, height

Arguments

layout -- a pango:layout object
index -- an integer for the byte index within layout
x -- an integer for the x coordinate
y -- an integer for the y coordinate
width -- an integer for the width
height -- an integer for the height

Details

Converts from an index within a Pango layout to the onscreen position corresponding to the grapheme at that index, which is represented as the coordinates of a rectangle.

Note that x is always the leading edge of the grapheme and x + width the trailing edge of the grapheme. If the directionality of the grapheme is right-to-left, then witdh will be negative.
 

See also

2025-2-15