Class TrueTypeFont
public class TrueTypeFont
- Inheritance
-
TrueTypeFont
- Inherited Members
Constructors
TrueTypeFont(ReadOnlyMemory<byte>, Uri?)
public TrueTypeFont(ReadOnlyMemory<byte> blob, Uri? SourceUri = null)
Parameters
blobReadOnlyMemory<byte>SourceUriUri
Fields
Blob
public readonly ReadOnlyMemory<byte> Blob
Field Value
SourceUri
public readonly Uri? SourceUri
Field Value
Properties
Cmap
public CMapTable? Cmap { get; }
Property Value
Face
public FontFace Face { get; }
Property Value
GPos
public GPosTable? GPos { get; }
Property Value
Glyf
public GlyfTable? Glyf { get; }
Property Value
Head
public HeaderTable? Head { get; }
Property Value
Hhea
public HorizontalHeaderTable? Hhea { get; }
Property Value
Hmtx
public HorizontalMetricsTable? Hmtx { get; }
Property Value
Kern
public KernTable? Kern { get; }
Property Value
Kerning
public TrueTypeFont.KerningQuery Kerning { get; }
Property Value
Loca
public LocaTable? Loca { get; }
Property Value
Maxp
public MaxProfileTable? Maxp { get; }
Property Value
Name
public NameTable? Name { get; }
Property Value
OS2
public OS2Table? OS2 { get; }
Property Value
Post
public PostTable? Post { get; }
Property Value
Tables
public IReadOnlyDictionary<string, TrueTypeFont.TableRecord> Tables { get; }
Property Value
Methods
FontFace(ReadOnlySpan<byte>)
public static FontFace FontFace(ReadOnlySpan<byte> fontData)
Parameters
fontDataReadOnlySpan<byte>
Returns
FontFace(HeaderTable?, NameTable?, OS2Table?)
Extracts a FontFace(HeaderTable?, NameTable?, OS2Table?) from minimal parsed font tables.
public static FontFace FontFace(HeaderTable? head, NameTable? name, OS2Table? os2)
Parameters
headHeaderTableThe HeaderTable used to determine italic style (via macStyle flags).
nameNameTableThe NameTable containing font naming information.
os2OS2TableThe OS2Table containing weight and width data.
Returns
- FontFace
A constructed FontFace(HeaderTable?, NameTable?, OS2Table?).
GetGlyphIndexFromChar(int)
public int? GetGlyphIndexFromChar(int unicode)
Parameters
unicodeint
Returns
- int?
GetGlyphName(int)
public string? GetGlyphName(int glyphId)
Parameters
glyphIdint
Returns
MeasureText(string, Font, TextAlign, TextBaseline)
public TextMetrics MeasureText(string text, Font font, TextAlign textAlign = TextAlign.Left, TextBaseline textBaseline = TextBaseline.Alphabetic)
Parameters
textstringfontFonttextAlignTextAligntextBaselineTextBaseline
Returns
Metrics(Font)
public FontMetrics Metrics(Font font)
Parameters
fontFont
Returns
TryGetGlyph(int, out GlyphShape)
public bool TryGetGlyph(int glyphId, out GlyphShape shape)
Parameters
glyphIdintshapeGlyphShape