Vixen
02b45cc4
csharp
public readonly record struct WrappedLine

One line of a wrapped paragraph, as a range of the source.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ A range, not a slice of the shaped glyphs, and that is the decision this whole type rests on. Cutting a shaped paragraph at a break keeps whatever the shaper did across it: a ligature spanning the break survives onto one of the two lines, and a cursively joined script keeps a medial form on a letter that is now final. The only correct fix is to shape each line, and the only thing a caller needs in order to do that is where the line starts and ends.

Fields and properties (5)

  • public int Start

    Where it begins in the source text, as a UTF-16 index.

  • public int Length

    How many characters it covers, including any trailing whitespace.

  • public float Advance

    How wide it is in design units, not counting whitespace at its end.

  • public bool Mandatory

    Whether the text required the line to end where it did.

  • public int End

    One past the line's last character.

Methods (2)

  • public WrappedLine(int Start, int Length, float Advance, bool Mandatory)

    One line of a wrapped paragraph, as a range of the source.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (3)

  • LineWrapTestsVixen.Ui.Text.Tests
  • LineWrapperVixen.Ui.Text
  • UiElementVixen.Ui