Skip to main content

TextLine Class

Represents a line of text that is used for text rendering.

Definition

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

public abstract class TextLine : IDisposable
View Source
InheritanceObject → TextLine
ImplementsIDisposable

Constructors

TextLine()Initializes a new instance of the TextLine class

Properties

BaselineGets the distance from the top to the baseline of the current TextLine object.
ExtentGets the distance from the top-most to bottom-most black pixel in a line.
FirstTextSourceIndexGets the first TextSource position of the current line.
HasCollapsedGets a value that indicates whether the line is collapsed.
HasOverflowedGets a value that indicates whether content of the line overflows the specified paragraph width.
HeightGets the height of a line of text.
LengthGets the total number of TextSource positions of the current line.
NewLineLengthGets the number of newline characters at the end of a line.
OverhangAfterGets the distance that black pixels extend beyond the bottom alignment edge of a line.
OverhangLeadingGets the distance that black pixels extend prior to the left leading alignment edge of the line.
OverhangTrailingGets the distance that black pixels extend following the right trailing alignment edge of the line.
StartGets the distance from the start of a paragraph to the starting point of a line.
TextLineBreakGets the state of the line when broken by line breaking process.
TextRunsGets the text runs that are contained within a line.
TrailingWhitespaceLengthGets the number of whitespace code points beyond the last non-blank character in a line.
WidthGets the width of a line of text, excluding trailing whitespace characters.
WidthIncludingTrailingWhitespaceGets the width of a line of text, including trailing whitespace characters.

Methods

Collapse(TextCollapsingProperties[])Create a collapsed line based on collapsed text properties.
Dispose()Releases all resources used by the TextLine
Draw(DrawingContext, Point)Draws the TextLine at the given origin.
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)
GetBackspaceCaretCharacterHit(CharacterHit)Gets the previous character hit after backspacing.
GetCharacterHitFromDistance(Double)Gets the character hit corresponding to the specified distance from the beginning of the line.
GetDistanceFromCharacterHit(CharacterHit)Gets the distance from the beginning of the line to the specified character hit. CharacterHit.
GetHashCode()Serves as the default hash function.
(Inherited from Object)
GetNextCaretCharacterHit(CharacterHit)Gets the next character hit for caret navigation.
GetPreviousCaretCharacterHit(CharacterHit)Gets the previous character hit for caret navigation.
GetTextBounds(Int32, Int32)Get an array of bounding rectangles of a range of characters within a text line.
GetType()Gets the Type of the current instance.
(Inherited from Object)
Justify(JustificationProperties)Create a justified line based on justification text properties.
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