Layout.getCaretPos

Given an index within a layout, determines the positions that of the strong and weak cursors if the insertion point is at that index.

This is a variant of pango.layout.Layout.getCursorPos that applies font metric information about caret slope and offset to the positions it returns.

<picture> <source srcset="caret-metrics-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Caret metrics" src="caret-metrics-light.png"> </picture>

class Layout
void
getCaretPos

Parameters

index int

the byte index of the cursor

strongPos pango.types.Rectangle

location to store the strong cursor position

weakPos pango.types.Rectangle

location to store the weak cursor position