GlyphString.indexToX

Converts from character position to x position.

The X position is measured from the left edge of the run. Character positions are obtained using font metrics for ligatures where available, and computed by dividing up each cluster into equal portions, otherwise.

<picture> <source srcset="glyphstring-positions-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Glyph positions" src="glyphstring-positions-light.png"> </picture>

class GlyphString
void
indexToX

Parameters

text string

the text for the run

analysis pango.analysis.Analysis

the analysis information return from funcitemize

index int

the byte index within text

trailing bool

whether we should compute the result for the beginning (false) or end (true) of the character.

xPos int

location to store result