Skip to content

Commit 28dfaa7

Browse files
sebgodclaude
andcommitted
Add IGlyphRasterizer and GlyphBitmap for font-agnostic glyph rasterization
Defines a public interface and data type so rendering consumers can provide their own image library implementation (e.g. Magick.NET Q8 vs Q16-HDRI) without coupling the renderer to a specific flavor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 677ba4c commit 28dfaa7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/DIR.Lib/IGlyphRasterizer.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace DIR.Lib;
2+
3+
/// <summary>
4+
/// Rasterizes individual glyphs into RGBA pixel data.
5+
/// Consumers provide an implementation backed by their preferred image library.
6+
/// </summary>
7+
public interface IGlyphRasterizer
8+
{
9+
GlyphBitmap RasterizeGlyph(string fontPath, float fontSize, char character);
10+
}
11+
12+
/// <summary>
13+
/// Raw RGBA bitmap of a single rasterized glyph.
14+
/// </summary>
15+
public readonly record struct GlyphBitmap(byte[] Rgba, int Width, int Height);

0 commit comments

Comments
 (0)