Table of Contents

Class TextRun

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Represents a run of text spanning a series of graphemes within a string.

public class TextRun
Inheritance
TextRun
Derived
Inherited Members

Properties

End

Gets or sets the exclusive end index of the last grapheme in this TextRun.

public int End { get; set; }

Property Value

int

Font

Gets or sets the font for this run.

public Font? Font { get; set; }

Property Value

Font

Placeholder

Gets or sets the inline placeholder represented by this run.

public TextPlaceholder? Placeholder { get; set; }

Property Value

TextPlaceholder?

Remarks

Placeholder runs are inserted at Start and must have End equal to Start.

Start

Gets or sets the inclusive start index of the first grapheme in this TextRun.

public int Start { get; set; }

Property Value

int

TextAttributes

Gets or sets the text attributes applied to this run.

public TextAttributes TextAttributes { get; set; }

Property Value

TextAttributes

TextDecorations

Gets or sets the text decorations applied to this run.

public TextDecorations TextDecorations { get; set; }

Property Value

TextDecorations

Methods

Slice(ReadOnlySpan<char>)

Returns the slice of the given text representing this TextRun.

public ReadOnlySpan<char> Slice(ReadOnlySpan<char> text)

Parameters

text ReadOnlySpan<char>

The text to slice.

Returns

ReadOnlySpan<char>

The ReadOnlySpan<T>.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.