ImageSharp/SixLabors.Fonts/Rendering/GlyphRendererExtensions.cs
2026-08-03 22:31:27 +02:00

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;
}
}
}