Back to API Reference
Struct

TextLine

sealed

Represents a line of text after line breaking.

public bool IsRtl{ get }

True when the line's paragraph base direction is right-to-left (UAX #9 odd embedding level).

public TextRange range

The codepoint range covered by this line.

public int runStart

Index of the first run in the ordered runs buffer for this line.

public int runCount

Number of runs in this line.

public int glyphStart

Index of the first positioned glyph belonging to this line (set during layout).

public int glyphCount

Number of positioned glyphs belonging to this line (set during layout).

public float width

Content width in font units (excluding trailing whitespace).

public float widthPx

Measured line width in mesh-local pixels, set during layout.

public float trailingWhitespace

Width of trailing whitespace excluded from width, in font units.

public byte paragraphBaseLevel

The base BiDi level of the paragraph containing this line.

public float startMargin

Left margin for this line (e.g., for list indentation).

public float advance

Vertical distance from this line's baseline to the next one's, set during layout; zero on the last line, which advances to nothing. Valid only while HasLineAdvances holds — a re-break clears it.

public float advancePrefix

Inclusive prefix sum of advance over lines 0..this, set during layout, which lets a Y coordinate find its line by binary search rather than accumulation. Valid only while HasLineAdvances holds.

public float overReserve

Extra leading reserved above this line for tall boundary content such as over-ruby; on the first line it reserves the block's top instead. Written through ReserveLineSpace from a line-height callback, largest wins.

public float underReserve

Extra leading reserved below this line; on the last line it reserves the block's bottom instead. Written through ReserveLineSpace from a line-height callback, largest wins.

public float gap

Signed adjustment to the gap between this line and the next — negative pulls them together, down to full overlap, and the gap never inverts. Unused on the last line, so block edges stay untouched. Written through AddLineGap from a line-height callback, requests summing.

public bool endedByMandatoryBreak

True when this line was terminated by a UAX #14 mandatory break (CR / LF / NEL / LS / PS / etc.) — i.e. the next line starts a new paragraph for justification purposes.