x_pos = pglyphstring:IndexToX(text$, analysis, index, trailing)
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.
text$
False
) or end (True
) of the character