Skip to main content

TextLayout(String, Typeface, Double, IBrush, TextAlignment, TextWrapping, TextTrimming, TextDecorationCollection, FlowDirection, Double, Double, Double, Double, Int32, IReadOnlyList<ValueSpan<TextRunProperties>>) Constructor

Initializes a new instance of the TextLayout class.

Definition

Namespace: Avalonia.Media.TextFormatting
Assembly: Avalonia.Base (in Avalonia.Base.dll)

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

Parameters

  String
The text.
  Typeface
The typeface.
  Double
Size of the font.
  IBrush
The foreground.
  TextAlignment  (Optional)
The text alignment.
  TextWrapping  (Optional)
The text wrapping.
  TextTrimming  (Optional)
The text trimming.
  TextDecorationCollection  (Optional)
The text decorations.
  FlowDirection  (Optional)
The text flow direction.
  Double  (Optional)
The maximum width.
  Double  (Optional)
The maximum height.
  Double  (Optional)
The height of each line of text.
  Double  (Optional)
The letter spacing that is applied to rendered glyphs.
  Int32  (Optional)
The maximum number of text lines.
  IReadOnlyList(ValueSpan(TextRunProperties))  (Optional)
The text style overrides.

See Also

Reference

TextLayout Class
TextLayout Overload
Avalonia.Media.TextFormatting Namespace