Interface IAsciiFont
Defines the traits implemented by ASCII font providers.
Namespace: Sharpie.Abstractions
Assembly: sharpie.dll
Syntax
[PublicAPI]
public interface IAsciiFont
Properties
Baseline
The font baseline.
Declaration
int Baseline { get; }
Property Value
Type | Description |
---|---|
int |
Height
The font height.
Declaration
int Height { get; }
Property Value
Type | Description |
---|---|
int |
Layout
The font's layout.
Declaration
AsciiFontLayout Layout { get; }
Property Value
Type | Description |
---|---|
AsciiFontLayout |
Name
The font's name.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
GetGlyph(Rune, Style)
Tries to get a glyph for a given char
.
Declaration
IDrawable GetGlyph(Rune @char, Style style)
Parameters
Type | Name | Description |
---|---|---|
Rune | char | The character. |
Style | style | The style to apply to the glyph. |
Returns
Type | Description |
---|---|
IDrawable | The output glyph, if found. Otherwise, the font will substitute the glyph with something else. |
GetGlyphs(ReadOnlySpan<Rune>, Style)
Tries to get a drawing for a given list of chars
.
Declaration
IDrawable GetGlyphs(ReadOnlySpan<Rune> chars, Style style)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<Rune> | chars | The characters. |
Style | style | The style to apply to the glyphs. |
Returns
Type | Description |
---|---|
IDrawable | The output glyphs. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
GetGlyphs(string, Style)
Tries to get a drawing for a given text
.
Declaration
IDrawable GetGlyphs(string text, Style style)
Parameters
Type | Name | Description |
---|---|---|
string | text | The text. |
Style | style | The style to apply to the glyphs. |
Returns
Type | Description |
---|---|
IDrawable | The output glyphs. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
HasGlyph(Rune)
Checks if the font contains a given glyph.
Declaration
bool HasGlyph(Rune @char)
Parameters
Type | Name | Description |
---|---|---|
Rune | char | The character. |
Returns
Type | Description |
---|---|
bool |
|