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¶
| Name | Summary |
|---|---|
| .ctor | Represents a segment of text with optional formatting. |
Properties¶
| Name | Summary |
|---|---|
| Text | Gets or sets the text content. |
| StartIndex | Gets or sets the start index in the document. |
| EndIndex | Gets the end index in the document. |
| Length | Gets the number of rendered document positions consumed by this segment. |
| IsBold | Gets or sets a value indicating whether this segment is bold. |
| IsItalic | Gets or sets a value indicating whether this segment is italic. |
| IsUnderline | Gets or sets a value indicating whether this segment is underlined. |
| IsStrikethrough | Gets or sets a value indicating whether this segment has strikethrough. |
| Foreground | Gets or sets the foreground color for this segment. |
| Background | Gets or sets the background color for this segment. |
| FontSize | Gets or sets the font size for this segment. |
| FontFamily | Gets or sets the font family for this segment. |
| IsLineBreak | Gets or sets a value indicating whether this segment represents a line break. |
| IsParagraphBreak | Gets or sets a value indicating whether this segment represents a paragraph break. |
| IsImage | Gets or sets a value indicating whether this segment represents an image. |
| ImageSource | Gets or sets the source for the image when [IsImage](# is true. |
| ImageWidth | Gets or sets the image width in device independent pixels. |
| ImageHeight | Gets or sets the image height in device independent pixels. |
| ImageAlignment | Gets or sets the alignment used when rendering the image. |
| ParagraphAlignment | Gets or sets the text alignment applied to a paragraph break. |
| HasRenderableText | Gets a value indicating whether the segment contains visible text. |
| FontWeight | Gets the font weight based on formatting. |
| FontStyle | Gets the font style based on formatting. |
| TextDecorations | Gets the text decorations based on formatting. |
Methods¶
| Name | Summary |
|---|---|
| Clone | Creates a clone of this segment. |
| HasSameFormatting | Checks if this segment has the same formatting as another segment. |
| static CreateLineBreak | Creates a line break segment used for block separation. |
| static CreateParagraphBreak | Creates a paragraph break marker. |
| static CreateImage | Creates an inline image segment. |