Table of Contents

Interface IGlyphTypeface

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll
[Unstable]
public interface IGlyphTypeface : IDisposable
Inherited Members

Properties

FamilyName

Gets the family name for the IGlyphTypeface object.

string FamilyName { get; }

Property Value

string

FontSimulations

Gets the algorithmic style simulations applied to this glyph typeface.

FontSimulations FontSimulations { get; }

Property Value

FontSimulations

GlyphCount

Gets the number of glyphs held by this glyph typeface.

int GlyphCount { get; }

Property Value

int

Metrics

Gets the font metrics.

FontMetrics Metrics { get; }

Property Value

FontMetrics

The font metrics.

Stretch

Gets the FontStretch value for the IGlyphTypeface object.

FontStretch Stretch { get; }

Property Value

FontStretch

Style

Gets the style for the IGlyphTypeface object.

FontStyle Style { get; }

Property Value

FontStyle

Weight

Gets the designed weight of the font represented by the IGlyphTypeface object.

FontWeight Weight { get; }

Property Value

FontWeight

Methods

GetGlyph(uint)

Returns an glyph index for the specified codepoint.

ushort GetGlyph(uint codepoint)

Parameters

codepoint uint

The codepoint.

Returns

ushort

A glyph index.

Remarks

Returns 0 if a glyph isn't found.

GetGlyphAdvance(ushort)

Returns the glyph advance for the specified glyph.

int GetGlyphAdvance(ushort glyph)

Parameters

glyph ushort

The glyph.

Returns

int

The advance.

GetGlyphAdvances(ReadOnlySpan<ushort>)

Returns an array of glyph advances in design em size.

int[] GetGlyphAdvances(ReadOnlySpan<ushort> glyphs)

Parameters

glyphs ReadOnlySpan<ushort>

The glyph indices.

Returns

int[]

An array of glyph advances.

GetGlyphs(ReadOnlySpan<uint>)

Returns an array of glyph indices. Codepoints that are not represented by the font are returned as

0
.
ushort[] GetGlyphs(ReadOnlySpan<uint> codepoints)

Parameters

codepoints ReadOnlySpan<uint>

The codepoints to map.

Returns

ushort[]

An array of glyph indices.

TryGetGlyph(uint, out ushort)

Tries to get an glyph index for specified codepoint.

bool TryGetGlyph(uint codepoint, out ushort glyph)

Parameters

codepoint uint

The codepoint.

glyph ushort

A glyph index.

Returns

bool

true if an glyph index was found, false otherwise.

TryGetGlyphMetrics(ushort, out GlyphMetrics)

Tries to get a glyph's metrics in em units.

bool TryGetGlyphMetrics(ushort glyph, out GlyphMetrics metrics)

Parameters

glyph ushort

The glyph id.

metrics GlyphMetrics

The glyph metrics.

Returns

bool

true if an glyph's metrics was found, false otherwise.

TryGetTable(uint, out byte[])

Returns the contents of the table data for the specified tag.

bool TryGetTable(uint tag, out byte[] table)

Parameters

tag uint

The table tag to get the data for.

table byte[]

The contents of the table data for the specified tag.

Returns

bool

Returns true if the content exists, otherwise false.