Table of Contents

Class TrueTypeFont

Namespace
Xui.Runtime.Software.Font
Assembly
Xui.Runtime.Software.dll
public class TrueTypeFont
Inheritance
TrueTypeFont
Inherited Members

Constructors

TrueTypeFont(ReadOnlyMemory<byte>, Uri?)

public TrueTypeFont(ReadOnlyMemory<byte> blob, Uri? SourceUri = null)

Parameters

blob ReadOnlyMemory<byte>
SourceUri Uri

Fields

Blob

public readonly ReadOnlyMemory<byte> Blob

Field Value

ReadOnlyMemory<byte>

SourceUri

public readonly Uri? SourceUri

Field Value

Uri

Properties

Cmap

public CMapTable? Cmap { get; }

Property Value

CMapTable

Face

public FontFace Face { get; }

Property Value

FontFace

GPos

public GPosTable? GPos { get; }

Property Value

GPosTable

Glyf

public GlyfTable? Glyf { get; }

Property Value

GlyfTable

Head

public HeaderTable? Head { get; }

Property Value

HeaderTable

Hhea

public HorizontalHeaderTable? Hhea { get; }

Property Value

HorizontalHeaderTable

Hmtx

public HorizontalMetricsTable? Hmtx { get; }

Property Value

HorizontalMetricsTable

Kern

public KernTable? Kern { get; }

Property Value

KernTable

Kerning

public TrueTypeFont.KerningQuery Kerning { get; }

Property Value

TrueTypeFont.KerningQuery

Loca

public LocaTable? Loca { get; }

Property Value

LocaTable

Maxp

public MaxProfileTable? Maxp { get; }

Property Value

MaxProfileTable

Name

public NameTable? Name { get; }

Property Value

NameTable

OS2

public OS2Table? OS2 { get; }

Property Value

OS2Table

Post

public PostTable? Post { get; }

Property Value

PostTable

Tables

public IReadOnlyDictionary<string, TrueTypeFont.TableRecord> Tables { get; }

Property Value

IReadOnlyDictionary<string, TrueTypeFont.TableRecord>

Methods

FontFace(ReadOnlySpan<byte>)

public static FontFace FontFace(ReadOnlySpan<byte> fontData)

Parameters

fontData ReadOnlySpan<byte>

Returns

FontFace

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

head HeaderTable

The HeaderTable used to determine italic style (via macStyle flags).

name NameTable

The NameTable containing font naming information.

os2 OS2Table

The OS2Table containing weight and width data.

Returns

FontFace

A constructed FontFace(HeaderTable?, NameTable?, OS2Table?).

GetGlyphIndexFromChar(int)

public int? GetGlyphIndexFromChar(int unicode)

Parameters

unicode int

Returns

int?

GetGlyphName(int)

public string? GetGlyphName(int glyphId)

Parameters

glyphId int

Returns

string

MeasureText(string, Font, TextAlign, TextBaseline)

public TextMetrics MeasureText(string text, Font font, TextAlign textAlign = TextAlign.Left, TextBaseline textBaseline = TextBaseline.Alphabetic)

Parameters

text string
font Font
textAlign TextAlign
textBaseline TextBaseline

Returns

TextMetrics

Metrics(Font)

public FontMetrics Metrics(Font font)

Parameters

font Font

Returns

FontMetrics

TryGetGlyph(int, out GlyphShape)

public bool TryGetGlyph(int glyphId, out GlyphShape shape)

Parameters

glyphId int
shape GlyphShape

Returns

bool