Skip to content

TextSegment class

Defined in

Namespace: CrissCross.Avalonia.UI.Controls Assembly: CrissCross.Avalonia.UI.dll Full name: CrissCross.Avalonia.UI.Controls.TextSegment Modifiers: public

Summary

        Represents a segment of text with optional formatting.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471

Remarks

Initializes a new instance of the TextSegment class.

Constructors

NameSummary
.ctorRepresents a segment of text with optional formatting.

Properties

NameSummary
TextGets or sets the text content.
StartIndexGets or sets the start index in the document.
EndIndexGets the end index in the document.
LengthGets the number of rendered document positions consumed by this segment.
IsBoldGets or sets a value indicating whether this segment is bold.
IsItalicGets or sets a value indicating whether this segment is italic.
IsUnderlineGets or sets a value indicating whether this segment is underlined.
IsStrikethroughGets or sets a value indicating whether this segment has strikethrough.
ForegroundGets or sets the foreground color for this segment.
BackgroundGets or sets the background color for this segment.
FontSizeGets or sets the font size for this segment.
FontFamilyGets or sets the font family for this segment.
IsLineBreakGets or sets a value indicating whether this segment represents a line break.
IsParagraphBreakGets or sets a value indicating whether this segment represents a paragraph break.
IsImageGets or sets a value indicating whether this segment represents an image.
ImageSourceGets or sets the source for the image when [IsImage](# is true.
ImageWidthGets or sets the image width in device independent pixels.
ImageHeightGets or sets the image height in device independent pixels.
ImageAlignmentGets or sets the alignment used when rendering the image.
ParagraphAlignmentGets or sets the text alignment applied to a paragraph break.
HasRenderableTextGets a value indicating whether the segment contains visible text.
FontWeightGets the font weight based on formatting.
FontStyleGets the font style based on formatting.
TextDecorationsGets the text decorations based on formatting.

Methods

NameSummary
CloneCreates a clone of this segment.
HasSameFormattingChecks if this segment has the same formatting as another segment.
static CreateLineBreakCreates a line break segment used for block separation.
static CreateParagraphBreakCreates a paragraph break marker.
static CreateImageCreates an inline image segment.
Inherited members