Skip to main content

IFontCollection Interface

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Represents a collection of font families and provides methods for querying and managing font typefaces within the collection.

public interface IFontCollection

Implements: IEnumerable<FontFamily>, IReadOnlyCollection<FontFamily>, IReadOnlyList<FontFamily>, IEnumerable, IDisposable

Remarks​

Implementations of this interface allow applications to retrieve font families, match characters to typefaces, and obtain glyph typefaces based on specific font properties.

Methods​

NameDescription
TryCreateSyntheticGlyphTypefaceNo summary available.
TryGetFamilyTypefacesNo summary available.
TryGetGlyphTypefaceNo summary available.
TryGetNearestMatchNo summary available.
TryMatchCharacterNo summary available.

TryCreateSyntheticGlyphTypeface Method​

public bool TryCreateSyntheticGlyphTypeface(Avalonia.Media.GlyphTypeface glyphTypeface, Avalonia.Media.FontStyle style, Avalonia.Media.FontWeight weight, Avalonia.Media.FontStretch stretch, Avalonia.Media.GlyphTypeface& syntheticGlyphTypeface)

Parameters​

glyphTypeface Avalonia.Media.GlyphTypeface

style Avalonia.Media.FontStyle

weight Avalonia.Media.FontWeight

stretch Avalonia.Media.FontStretch

syntheticGlyphTypeface Avalonia.Media.GlyphTypeface&

Returns​

bool

TryGetFamilyTypefaces Method​

public bool TryGetFamilyTypefaces(string familyName, System.Collections.Generic.IReadOnlyList<Avalonia.Media.Typeface>& familyTypefaces)

Parameters​

familyName string

familyTypefaces System.Collections.Generic.IReadOnlyList<Avalonia.Media.Typeface>&

Returns​

bool

TryGetGlyphTypeface Method​

public bool TryGetGlyphTypeface(string familyName, Avalonia.Media.FontStyle style, Avalonia.Media.FontWeight weight, Avalonia.Media.FontStretch stretch, Avalonia.Media.GlyphTypeface& glyphTypeface)

Parameters​

familyName string

style Avalonia.Media.FontStyle

weight Avalonia.Media.FontWeight

stretch Avalonia.Media.FontStretch

glyphTypeface Avalonia.Media.GlyphTypeface&

Returns​

bool

TryGetNearestMatch Method​

public bool TryGetNearestMatch(string familyName, Avalonia.Media.FontStyle style, Avalonia.Media.FontWeight weight, Avalonia.Media.FontStretch stretch, Avalonia.Media.GlyphTypeface& glyphTypeface)

Parameters​

familyName string

style Avalonia.Media.FontStyle

weight Avalonia.Media.FontWeight

stretch Avalonia.Media.FontStretch

glyphTypeface Avalonia.Media.GlyphTypeface&

Returns​

bool

TryMatchCharacter Method​

public bool TryMatchCharacter(int codepoint, Avalonia.Media.FontStyle fontStyle, Avalonia.Media.FontWeight fontWeight, Avalonia.Media.FontStretch fontStretch, string familyName, System.Globalization.CultureInfo culture, Avalonia.Media.Typeface& typeface)

Parameters​

codepoint int

fontStyle Avalonia.Media.FontStyle

fontWeight Avalonia.Media.FontWeight

fontStretch Avalonia.Media.FontStretch

familyName string

culture System.Globalization.CultureInfo

typeface Avalonia.Media.Typeface&

Returns​

bool

Properties​

NameDescription
KeyGet the font collection's key.

Key Property​

Get the font collection's key.

public Uri Key { get; set; }