Class TextRenderer
Encapsulated logic for laying out and then rendering text to a IGlyphRenderer surface.
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public class TextRenderer
Constructors
| Edit this page View SourceTextRenderer(IGlyphRenderer)
Initializes a new instance of the TextRenderer class.
Declaration
public TextRenderer(IGlyphRenderer renderer)
Parameters
Type | Name | Description |
---|---|---|
IGlyphRenderer | renderer | The renderer. |
Methods
| Edit this page View SourceRenderText(ReadOnlySpan<char>, TextOptions)
Renders the text to the default renderer.
Declaration
public void RenderText(ReadOnlySpan<char> text, TextOptions options)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<char> | text | The text to render. |
TextOptions | options | The style. |
RenderText(string, TextOptions)
Renders the text to the default renderer.
Declaration
public void RenderText(string text, TextOptions options)
Parameters
Type | Name | Description |
---|---|---|
string | text | The text to render. |
TextOptions | options | The text options. |
RenderTextTo(IGlyphRenderer, ReadOnlySpan<char>, TextOptions)
Renders the text to the renderer
.
Declaration
public static void RenderTextTo(IGlyphRenderer renderer, ReadOnlySpan<char> text, TextOptions options)
Parameters
Type | Name | Description |
---|---|---|
IGlyphRenderer | renderer | The target renderer. |
ReadOnlySpan<char> | text | The text to render. |
TextOptions | options | The text options. |
RenderTextTo(IGlyphRenderer, string, TextOptions)
Renders the text to the renderer
.
Declaration
public static void RenderTextTo(IGlyphRenderer renderer, string text, TextOptions options)
Parameters
Type | Name | Description |
---|---|---|
IGlyphRenderer | renderer | The target renderer. |
string | text | The text to render. |
TextOptions | options | The text option. |