Text Class
A renderable piece of text.
[DebuggerDisplay("{_text,nq}")]
[SuppressMessage("Naming", "CA1724:Type names should not match namespaces")]
public sealed class Text : Renderable, IRenderable, IHasJustification, IOverflowable
- Namespace
- Spectre
.Console - Interfaces
- Base Types
Attributes
-
Debugger
Display Attribute -
Suppress
Message Attribute
Constructors
-
Text
(string, Style) -
Initializes a new instance of the
Text
class.
Properties
- Justify? Justification
- Gets or sets the text alignment.
- int Length
- Gets the character count.
- int Lines
- Gets the number of lines in the text.
- Overflow? Overflow
- Gets or sets the text overflow strategy.
Methods
-
protected override Measurement Measure
(RenderOptions, int) - Measures the renderable object.
-
protected override IEnumerable<Segment> Render
(RenderOptions, int) - Renders the object.
Extension Methods
-
T Centered
<Text> () -
Sets the
IHasJustification
object to be centered. -
T Crop
<Text> () - Crops any overflowing text.
-
T Ellipsis
<Text> () - Crops any overflowing text and adds an ellipsis to the end.
-
T Fold
<Text> () - Folds any overflowing text.
-
IEnumerable<Segment> GetSegments
(IAnsiConsole) - Gets the segments for a renderable using the specified console.
-
T Justify
<Text> (Justify?) -
Sets the justification for an
IHasJustification
object. -
T LeftJustified
<Text> () -
Sets the
IHasJustification
object to be left justified. -
T Overflow
<Text> (Overflow) - Sets the overflow strategy.
-
T RightJustified
<Text> () -
Sets the
IHasJustification
object to be right justified.