Interface IGlyphRasterizer
Represents a glyph rasterizer that can convert font glyphs to textures.
public interface IGlyphRasterizer : IDisposable
- Inherited Members
- Extension Methods
Methods
ContainsGlyph(int)
Checks if the character is supported in this font.
bool ContainsGlyph(int codepoint)
Parameters
codepointintUnicode character codepoint to check.
Returns
- bool
true if the character with the specified codepoint is supported by this font instance; otherwise false.
GetFontMetrics(float, FontStyle)
Gets metrics for the font with the specified font size.
FontMetrics GetFontMetrics(float fontSize, FontStyle style)
Parameters
fontSizefloatExpected font size in points to calculate scaled metrics for.
styleFontStyleThe style of the font to use.
Returns
- FontMetrics
An instance of the FontMetrics struct with font calculated metrics.
GetGlyphMetrics(int, float, FontStyle)
Gets the metrics for a glyph at the specified size and style.
FontGlyph GetGlyphMetrics(int codepoint, float size, FontStyle style)
Parameters
codepointintThe Unicode codepoint of the glyph.
sizefloatThe size of the glyph in pixels.
styleFontStyleThe style of the font.
Returns
- FontGlyph
The metrics for the glyph.
GetKerning(int, int, float, FontStyle)
Gets the kerning between two glyphs.
float GetKerning(int first, int second, float size, FontStyle style)
Parameters
firstintFirst glyph codepoint.
secondintSecond glyph codepoint.
sizefloatFont size.
styleFontStyleFont style.
Returns
- float
The kerning value in pixels.
RasterizeGlyph(int, float, FontStyle)
Rasterizes a glyph at the specified size and style.
IMemoryOwner<byte>? RasterizeGlyph(int codepoint, float size, FontStyle style)
Parameters
codepointintThe Unicode codepoint of the glyph to rasterize.
sizefloatThe size of the glyph in pixels.
styleFontStyleThe style of the glyph.
Returns
- IMemoryOwner<byte>
The rasterized glyph pixels byte sequence.