Docsv3.20.2
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 HorizontalAlignment alignment

Alignment this line was actually laid out to, set during layout: the component's setting after every per-range override, the paragraph-last rule and the justification fallback have had their say. What a pass reads to place something on the edge the text was pinned to; never Justify on a line that ended up unjustified.

public float startMargin

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

public float baseline

Baseline of the line in pixels down from the top of the layout area, the space of y. Valid only while HasLineGeometry holds.

public float top

Top of the line's hit band, at the primary font's ascender above baseline. Bands of consecutive lines share edges, so every vertical position over the text belongs to exactly one line. Valid only while HasLineGeometry holds.

public float bottom

Bottom of the line's hit band: the next line's top, or for the last line the primary font's descender below baseline. Valid only while HasLineGeometry holds.

public float boxLeft

Left edge of the box the line is aligned in, in pixels from the left of the layout area; startMargin indents from it. Valid only while HasLineGeometry holds.

public float boxWidth

Width of the box the line is aligned in, in pixels; unbounded text reports FloatMax. Valid only while HasLineGeometry 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.