Name
playout:IndexToPos -- get onscreen position of grapheme
Synopsis
pos = playout:IndexToPos(index)
Function
Converts from an index within a Pango layout to the onscreen position corresponding to the grapheme at that index.

The return value is a table containing the fields x, y, width, and height to describe 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 width will be negative.

Inputs
index
byte index within the layout
Results
pos
rectangle containing the position of the grapheme

Show TOC