Class TtfFont
Represents a loaded TrueType or OpenType/TT font face. Implements IFont; exposes the full parsed table set via TtfTables.
Implements
Inherited Members
Namespace: DRIT.Drawing.Font.Ttf
Assembly: DRIT.Drawing.dll
Syntax
public sealed class TtfFont : IFont
Properties
Encoding
Encoding map that translates Unicode code points to glyph identifiers.
Declaration
public IFontEncoding Encoding { get; }
Property Value
| Type | Description |
|---|---|
| IFontEncoding |
FontFamily
Family name of the font, e.g. "Montserrat".
Declaration
public string FontFamily { get; }
Property Value
| Type | Description |
|---|---|
| string |
FontName
Full name of the font, e.g. "Montserrat Regular".
Declaration
public string FontName { get; }
Property Value
| Type | Description |
|---|---|
| string |
GlyphAccessor
Provides access to individual glyphs by identifier or index.
Declaration
public IGlyphAccessor GlyphAccessor { get; }
Property Value
| Type | Description |
|---|---|
| IGlyphAccessor |
Metrics
Font-level metrics (ascender, descender, units per em, etc.).
Declaration
public IFontMetrics Metrics { get; }
Property Value
| Type | Description |
|---|---|
| IFontMetrics |
NumGlyphs
Total number of glyphs in the font.
Declaration
public int NumGlyphs { get; }
Property Value
| Type | Description |
|---|---|
| int |
Style
Typographic style of this font face.
Declaration
public FontFaceStyle Style { get; }
Property Value
| Type | Description |
|---|---|
| FontFaceStyle |
TtfTables
All parsed OpenType tables for this font.
Declaration
public TtfTables TtfTables { get; }
Property Value
| Type | Description |
|---|---|
| TtfTables |
Methods
Save(Stream)
Serialises the (possibly modified) font to stream.
Declaration
public void Save(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream |
Save(string)
Serialises the (possibly modified) font to the file at filePath.
Declaration
public void Save(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath |
ToString()
Returns a string representation of this TrueType font.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |