TextLayout.

TextLayout(string, Typeface, double, IBrush, TextAlignment, TextWrapping, TextTrimming, TextDecorationCollection, double, double, double, int, IReadOnlyList<ValueSpan<TextRunProperties>>) Constructor

Summary

Initializes a new instance of the TextLayout class.
Namespace
Avalonia.Media.TextFormatting
Containing Type
TextLayout

Syntax

public TextLayout(string text, Typeface typeface, double fontSize, IBrush foreground, TextAlignment textAlignment = Left, TextWrapping textWrapping = NoWrap, TextTrimming textTrimming = None, TextDecorationCollection textDecorations = null, double maxWidth = Infinity, double maxHeight = Infinity, double lineHeight = NaN, int maxLines = 0, IReadOnlyList<ValueSpan<TextRunProperties>> textStyleOverrides = null)

Parameters

Name Type Description
text string The text.
typeface Typeface The typeface.
fontSize double Size of the font.
foreground IBrush The foreground.
textAlignment TextAlignment The text alignment.
textWrapping TextWrapping The text wrapping.
textTrimming TextTrimming The text trimming.
textDecorations TextDecorationCollection The text decorations.
maxWidth double The maximum width.
maxHeight double The maximum height.
lineHeight double The height of each line of text.
maxLines int The maximum number of text lines.
textStyleOverrides IReadOnlyList<ValueSpan<TextRunProperties>> The text style overrides.

Return Value

Type Description
void