Class TextRenderer
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
rendererIGlyphRendererThe renderer.
Methods
Render(TextShapingBuffer, GlyphOptions)
Renders shaped glyphs to the configured renderer.
public void Render(TextShapingBuffer buffer, GlyphOptions options)
Parameters
bufferTextShapingBufferThe buffer containing the shaped glyphs.
optionsGlyphOptionsThe 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
textReadOnlySpan<char>The text to render.
optionsTextOptionsThe text options. WrappingLength controls wrapping; use
-1to 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
glyphIdsReadOnlySpan<ushort>The glyph identifiers.
pointsReadOnlySpan<Vector2>The absolute glyph origins in pixel units.
optionsGlyphOptionsThe glyph options.
Render(string, TextOptions)
Renders the text to the configured renderer.
public void Render(string text, TextOptions options)
Parameters
textstringThe text to render.
optionsTextOptionsThe text options. WrappingLength controls wrapping; use
-1to disable wrapping.
Render(ushort, GlyphOptions)
Renders a glyph id to the configured renderer.
public void Render(ushort glyphId, GlyphOptions options)
Parameters
glyphIdushortThe glyph identifier.
optionsGlyphOptionsThe glyph options.
RenderTo(IGlyphRenderer, TextShapingBuffer, GlyphOptions)
Renders shaped glyphs to the renderer.
public static void RenderTo(IGlyphRenderer renderer, TextShapingBuffer buffer, GlyphOptions options)
Parameters
rendererIGlyphRendererThe target renderer.
bufferTextShapingBufferThe buffer containing the shaped glyphs.
optionsGlyphOptionsThe 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
rendererIGlyphRendererThe target renderer.
textReadOnlySpan<char>The text to render.
optionsTextOptionsThe text options. WrappingLength controls wrapping; use
-1to 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
rendererIGlyphRendererThe target renderer.
glyphIdsReadOnlySpan<ushort>The glyph identifiers.
pointsReadOnlySpan<Vector2>The absolute glyph origins in pixel units.
optionsGlyphOptionsThe glyph options.
RenderTo(IGlyphRenderer, string, TextOptions)
Renders the text to the renderer.
public static void RenderTo(IGlyphRenderer renderer, string text, TextOptions options)
Parameters
rendererIGlyphRendererThe target renderer.
textstringThe text to render.
optionsTextOptionsThe text options. WrappingLength controls wrapping; use
-1to disable wrapping.
RenderTo(IGlyphRenderer, ushort, GlyphOptions)
Renders a glyph id to the renderer.
public static void RenderTo(IGlyphRenderer renderer, ushort glyphId, GlyphOptions options)
Parameters
rendererIGlyphRendererThe target renderer.
glyphIdushortThe glyph identifier.
optionsGlyphOptionsThe glyph options.