public sealed class TextLayoutAn element's text, wrapped into the lines it is drawn on.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Three types, one for each thing a line of text is made of. A TextRun is one face; a TextLine is the runs sharing a baseline; a block is the lines stacked down the page. Most text is one line of one run and costs no more than it did when that was the only shape available.
⚠ Wrapped in pixels, and each line shaped on its own. The break opportunities come from UAX#14 and are about the characters; the widths are measured across whatever faces the fallback chose, which is why the wrapping happens here rather than in Vixen.Ui.Text's LineWrapper overload that takes a ShapedText — that one is a single font by construction. Once the breaks are known, each line's text is covered and shaped by itself, which is what a line is: a break stops a ligature and unjoins an Arabic word, and it is supposed to.
Fields and properties (3)
public ImmutableArray<TextLine> LinesThe lines, top to bottom.
public float WidthHow wide the widest line is, in pixels.
public float HeightHow tall all the lines together are, in pixels.
Methods (9)
public TextLayout(ImmutableArray<TextLine> lines)Builds a block from its lines, in order.
public float TopOf(int line)Where a line's top edge sits, in pixels from the top of the block.
public int LineOf(int index)Which line a caret index falls on.
public int LineOf(int index, CaretAffinity affinity)Which line a caret falls on, given which side of the index it belongs to.
public (float X, float Y) CaretAt(int index)Where a caret sits, in pixels from the top left of the block.
public (float X, float Y) CaretAt(int index, CaretAffinity affinity)Where a caret sits, given which side of the index it belongs to.
public int CaretIndexAt(float x, float y)Which caret index a point in the block lands on.
public (int Index, CaretAffinity Affinity) CaretPositionAt(float x, float y)Which caret a point in the block lands on, and which side of it.
public static LayoutSize Measure(in MeasureRequest request)Measures a leaf whose size is its text.
Used by (31)
- BidiDirectionTestsVixen.Ui.Tests
- BidiFallbackTestsVixen.Ui.Tests
- BidiMirroringTestsVixen.Ui.Tests
- CaretAffinityTestsVixen.Ui.Tests
- CaretAffinityTestsVixen.Ui.Controls.Tests
- CodeEditorVixen.Ui.Controls.Advanced
- DrawListBuilderVixen.Ui
- FieldProbeVixen.Ui.Controls.Tests
- FontFallbackTestsVixen.Ui.Tests
- FontFeatureStyleTestsVixen.Ui.Tests
- FontRegistryTestsVixen.Ui.Tests
- HyphensTestsVixen.Ui.Tests
- LanguageTestsVixen.Ui.Tests
- LineBreakTestsVixen.Ui.Tests
- LineClampTestsVixen.Ui.Tests
- SelectionRangeTestsVixen.Ui.Controls.Tests
- TabSizeTestsVixen.Ui.Tests
- TextChildDescenderTestsVixen.Ui.Testing.Tests
- TextFieldVixen.Ui.Controls
- TextFieldTestsVixen.Ui.Controls.Tests
- TextFloatBandTestsVixen.Ui.Tests
- TextIndentTestsVixen.Ui.Tests
- TextOverflowTestsVixen.Ui.Tests
- TextTestsVixen.Ui.Tests
- TextTransformTestsVixen.Ui.Tests
- TextWrapTestsVixen.Ui.Tests
- TextWrappingPixelTestsVixen.Ui.Controls.Tests
- TrailingSpaceAlignmentTestsVixen.Ui.Tests
- UiElementVixen.Ui
- WhiteSpaceBreakSpacesTestsVixen.Ui.Tests
- WhiteSpacePreTestsVixen.Ui.Tests