Skip to main content

FontManager Class

Definition

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

The font manager is used to query the system's installed fonts and is responsible for caching loaded fonts. It is also responsible for the font fallback.

public class FontManager

Inheritance: object -> FontManager

Implements: IDisposable

Constructors

NameDescription
FontManagerNo summary available.

FontManager Constructor

public FontManager(Avalonia.Platform.IFontManagerImpl platformImpl)

Parameters

platformImpl Avalonia.Platform.IFontManagerImpl

Methods

NameDescription
AddFontCollectionAdd a font collection to the manager.
RemoveFontCollectionRemoves the font collection that corresponds to specified key.
TryGetGlyphTypefaceNo summary available.
TryMatchCharacterNo summary available.

AddFontCollection Method

Add a font collection to the manager.

public void AddFontCollection(Avalonia.Media.Fonts.IFontCollection fontCollection)

Parameters

fontCollection Avalonia.Media.Fonts.IFontCollection

The font collection.

Remarks

If a font collection's key is already present the collection is replaced.

Exceptions

RemoveFontCollection Method

Removes the font collection that corresponds to specified key.

public void RemoveFontCollection(Uri key)

Parameters

key Uri

The font collection's key.

TryGetGlyphTypeface Method

public bool TryGetGlyphTypeface(Avalonia.Media.Typeface typeface, Avalonia.Media.GlyphTypeface& glyphTypeface)

Parameters

typeface Avalonia.Media.Typeface

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, Avalonia.Media.FontFamily fontFamily, System.Globalization.CultureInfo culture, Avalonia.Media.Typeface& typeface)

Parameters

codepoint int

fontStyle Avalonia.Media.FontStyle

fontWeight Avalonia.Media.FontWeight

fontStretch Avalonia.Media.FontStretch

fontFamily Avalonia.Media.FontFamily

culture System.Globalization.CultureInfo

typeface Avalonia.Media.Typeface&

Returns

bool

Properties

NameDescription
CurrentGet the current font manager instance.
DefaultFontFamilyGets the system's default font family.
SystemFontsGet all system fonts.

Current Property

Get the current font manager instance.

public Avalonia.Media.FontManager Current { get; set; }

DefaultFontFamily Property

Gets the system's default font family.

public Avalonia.Media.FontFamily DefaultFontFamily { get; set; }

SystemFonts Property

Get all system fonts.

public Avalonia.Media.Fonts.IFontCollection SystemFonts { get; set; }

Fields

NameDescription
CompositeFontSchemeNo summary available.
FontCollectionSchemeNo summary available.
SystemFontSchemeNo summary available.

CompositeFontScheme Field

public string CompositeFontScheme

FontCollectionScheme Field

public string FontCollectionScheme

SystemFontScheme Field

public string SystemFontScheme