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

Render(TextShapingBuffer, GlyphOptions)

Renders shaped glyphs to the configured renderer.

public void Render(TextShapingBuffer buffer, GlyphOptions options)

Parameters

buffer TextShapingBuffer

The buffer containing the shaped glyphs.

options GlyphOptions

The glyph options supplying the shaping font, resolution, and baseline origin.

Render(ReadOnlySpan<char>, TextOptions)

Renders the text to the configured renderer.

public void Render(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.

Render(ReadOnlySpan<ushort>, ReadOnlySpan<Vector2>, GlyphOptions)

Renders positioned glyph ids to the configured renderer.

public void Render(ReadOnlySpan<ushort> glyphIds, ReadOnlySpan<Vector2> points, GlyphOptions options)

Parameters

glyphIds ReadOnlySpan<ushort>

The glyph identifiers.

points ReadOnlySpan<Vector2>

The absolute glyph origins in pixel units.

options GlyphOptions

The glyph options.

Render(string, TextOptions)

Renders the text to the configured renderer.

public void Render(string text, TextOptions options)

Parameters

text string

The text to render.

options TextOptions

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

Render(ushort, GlyphOptions)

Renders a glyph id to the configured renderer.

public void Render(ushort glyphId, GlyphOptions options)

Parameters

glyphId ushort

The glyph identifier.

options GlyphOptions

The glyph options.

RenderTo(IGlyphRenderer, TextShapingBuffer, GlyphOptions)

Renders shaped glyphs to the renderer.

public static void RenderTo(IGlyphRenderer renderer, TextShapingBuffer buffer, GlyphOptions options)

Parameters

renderer IGlyphRenderer

The target renderer.

buffer TextShapingBuffer

The buffer containing the shaped glyphs.

options GlyphOptions

The glyph options supplying the shaping font, resolution, and baseline origin.

RenderTo(IGlyphRenderer, ReadOnlySpan<char>, TextOptions)

Renders the text to the renderer.

public static void RenderTo(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.

RenderTo(IGlyphRenderer, ReadOnlySpan<ushort>, ReadOnlySpan<Vector2>, GlyphOptions)

Renders positioned glyph ids to the renderer.

public static void RenderTo(IGlyphRenderer renderer, ReadOnlySpan<ushort> glyphIds, ReadOnlySpan<Vector2> points, GlyphOptions options)

Parameters

renderer IGlyphRenderer

The target renderer.

glyphIds ReadOnlySpan<ushort>

The glyph identifiers.

points ReadOnlySpan<Vector2>

The absolute glyph origins in pixel units.

options GlyphOptions

The glyph options.

RenderTo(IGlyphRenderer, string, TextOptions)

Renders the text to the renderer.

public static void RenderTo(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.

RenderTo(IGlyphRenderer, ushort, GlyphOptions)

Renders a glyph id to the renderer.

public static void RenderTo(IGlyphRenderer renderer, ushort glyphId, GlyphOptions options)

Parameters

renderer IGlyphRenderer

The target renderer.

glyphId ushort

The glyph identifier.

options GlyphOptions

The glyph options.