26 lines
864 B
C#
26 lines
864 B
C#
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using System;
|
|
|
|
namespace SixLabors.Fonts.Rendering {
|
|
/// <summary>
|
|
/// A surface that can have a glyph rendered to it as a series of actions.
|
|
/// </summary>
|
|
public static class GlyphRendererExtensions
|
|
{
|
|
/// <summary>
|
|
/// Renders the text.
|
|
/// </summary>
|
|
/// <param name="renderer">The target renderer surface.</param>
|
|
/// <param name="text">The text.</param>
|
|
/// <param name="options">The options.</param>
|
|
/// <returns>Returns the original <paramref name="renderer"/></returns>
|
|
public static IGlyphRenderer Render(this IGlyphRenderer renderer, ReadOnlySpan<char> text, TextOptions options)
|
|
{
|
|
new TextRenderer(renderer).RenderText(text, options);
|
|
return renderer;
|
|
}
|
|
}
|
|
}
|