Table of Contents

Class TextRenderer

Namespace
SixLabors.Fonts.Rendering
Assembly
SixLabors.Fonts.dll

Encapsulates logic for laying out and then rendering text to a IGlyphRenderer surface.

public class TextRenderer
Inheritance
TextRenderer
Inherited Members

Constructors

TextRenderer(IGlyphRenderer)

Initializes a new instance of the TextRenderer class.

public TextRenderer(IGlyphRenderer renderer)

Parameters

renderer IGlyphRenderer

The renderer.

Methods

RenderText(ReadOnlySpan<char>, TextOptions)

Renders the text to the configured renderer.

public void RenderText(ReadOnlySpan<char> text, TextOptions options)

Parameters

text ReadOnlySpan<char>

The text to render.

options TextOptions

The text options. WrappingLength controls wrapping; use -1 to disable wrapping.

RenderText(string, TextOptions)

Renders the text to the configured renderer.

public void RenderText(string text, TextOptions options)

Parameters

text string

The text to render.

options TextOptions

The text options. WrappingLength controls wrapping; use -1 to disable wrapping.

RenderTextTo(IGlyphRenderer, ReadOnlySpan<char>, TextOptions)

Renders the text to the renderer.

public static void RenderTextTo(IGlyphRenderer renderer, ReadOnlySpan<char> text, TextOptions options)

Parameters

renderer IGlyphRenderer

The target renderer.

text ReadOnlySpan<char>

The text to render.

options TextOptions

The text options. WrappingLength controls wrapping; use -1 to disable wrapping.

RenderTextTo(IGlyphRenderer, string, TextOptions)

Renders the text to the renderer.

public static void RenderTextTo(IGlyphRenderer renderer, string text, TextOptions options)

Parameters

renderer IGlyphRenderer

The target renderer.

text string

The text to render.

options TextOptions

The text options. WrappingLength controls wrapping; use -1 to disable wrapping.