Interface IFont
Represents a loaded font face and provides access to its metadata, metrics, encoding map, and glyph data.
Namespace: DRIT.Drawing.Font.Core
Assembly: DRIT.Drawing.dll
Syntax
public interface IFont
Properties
Encoding
Encoding map that translates Unicode code points to glyph identifiers.
Declaration
IFontEncoding Encoding { get; }
Property Value
| Type | Description |
|---|---|
| IFontEncoding |
FontFamily
Family name of the font, e.g. "Montserrat".
Declaration
string FontFamily { get; }
Property Value
| Type | Description |
|---|---|
| string |
FontName
Full name of the font, e.g. "Montserrat Regular".
Declaration
string FontName { get; }
Property Value
| Type | Description |
|---|---|
| string |
GlyphAccessor
Provides access to individual glyphs by identifier or index.
Declaration
IGlyphAccessor GlyphAccessor { get; }
Property Value
| Type | Description |
|---|---|
| IGlyphAccessor |
Metrics
Font-level metrics (ascender, descender, units per em, etc.).
Declaration
IFontMetrics Metrics { get; }
Property Value
| Type | Description |
|---|---|
| IFontMetrics |
NumGlyphs
Total number of glyphs in the font.
Declaration
int NumGlyphs { get; }
Property Value
| Type | Description |
|---|---|
| int |
Style
Typographic style of this font face.
Declaration
FontFaceStyle Style { get; }
Property Value
| Type | Description |
|---|---|
| FontFaceStyle |
Methods
Save(Stream)
Serialises the (possibly modified) font to stream.
Declaration
void Save(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream |
Save(string)
Serialises the (possibly modified) font to the file at filePath.
Declaration
void Save(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath |