TextLayout Class
Represents a multi line text layout.
Definition
Namespace: Avalonia.Media.TextFormatting
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public class TextLayout : IDisposable
Public Class TextLayout
Implements IDisposable
type TextLayout =
class
interface IDisposable
end
Inheritance | Object → TextLayout |
Implements | IDisposable |
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
Baseline | The distance from the top of the first line to the baseline of the first line. |
Extent | The distance from the topmost black pixel of the first line to the bottommost black pixel of the last line. |
Height | The distance from the top of the first line to the bottom of the last line. |
LetterSpacing | Gets the text spacing. |
LineHeight | Gets or sets the height of each line of text. |
MaxHeight | Gets the maximum height. |
MaxLines | Gets the maximum number of text lines. |
MaxWidth | Gets the maximum width. |
OverhangAfter | The distance from the bottom of the last line to the extent bottom. |
OverhangLeading | The maximum distance from the leading black pixel to the leading alignment point of a line. |
OverhangTrailing | The maximum distance from the trailing black pixel to the trailing alignment point of a line. |
TextLines | Gets the text lines. |
Width | The 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. |
WidthIncludingTrailingWhitespace | The 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) |