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

Attributes

DebuggerDisplayAttribute
SuppressMessageAttribute

Constructors

Text(string, Style)
Initializes a new instance of the Text class.

Properties

static Text Empty
Gets an empty Text instance.
Justify? Justification
Gets or sets the text alignment.
int Length
Gets the character count.
int Lines
Gets the number of lines in the text.
static Text NewLine
Gets an instance of Text containing a new line.
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.