Skip to main content

TextLayout Class

Represents a multi line text layout.

Definition

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

public class TextLayout : IDisposable
View Source
InheritanceObject → TextLayout
ImplementsIDisposable

Constructors

TextLayout(ITextSource, TextParagraphProperties, TextTrimming, Double, Double, Int32)Initializes a new instance of the TextLayout class.
TextLayout(String, Typeface, Double, IBrush, TextAlignment, TextWrapping, TextTrimming, TextDecorationCollection, FlowDirection, Double, Double, Double, Double, Int32, IReadOnlyList(ValueSpan(TextRunProperties)))Initializes a new instance of the TextLayout class.
TextLayout(String, Typeface, FontFeatureCollection, Double, IBrush, TextAlignment, TextWrapping, TextTrimming, TextDecorationCollection, FlowDirection, Double, Double, Double, Double, Int32, IReadOnlyList(ValueSpan(TextRunProperties)))Initializes a new instance of the TextLayout class.

Properties

BaselineThe distance from the top of the first line to the baseline of the first line.
ExtentThe distance from the topmost black pixel of the first line to the bottommost black pixel of the last line.
HeightThe distance from the top of the first line to the bottom of the last line.
LetterSpacingGets the text spacing.
LineHeightGets or sets the height of each line of text.
MaxHeightGets the maximum height.
MaxLinesGets the maximum number of text lines.
MaxWidthGets the maximum width.
OverhangAfterThe distance from the bottom of the last line to the extent bottom.
OverhangLeadingThe maximum distance from the leading black pixel to the leading alignment point of a line.
OverhangTrailingThe maximum distance from the trailing black pixel to the trailing alignment point of a line.
TextLinesGets the text lines.
WidthThe maximum advance width between the leading and trailing alignment points of a line, excluding the width of whitespace characters at the end of the line.
WidthIncludingTrailingWhitespaceThe maximum advance width between the leading and trailing alignment points of a line, including the width of whitespace characters at the end of the line.

Methods

Dispose()Releases all resources used by the TextLayout
Draw(DrawingContext, Point)Draws the text layout.
Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize()Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCode()Serves as the default hash function.
(Inherited from Object)
GetLineIndexFromCharacterIndex(Int32, Boolean) 
GetType()Gets the Type of the current instance.
(Inherited from Object)
HitTestPoint(Point) 
HitTestTextPosition(Int32)Get the pixel location relative to the top-left of the layout box given the text position.
HitTestTextRange(Int32, Int32) 
MemberwiseClone()Creates a shallow copy of the current Object.
(Inherited from Object)
ToString()Returns a string that represents the current object.
(Inherited from Object)

See Also

Reference

Avalonia.Media.TextFormatting Namespace