Class FontManager
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 sealed class FontManager
- Inheritance
-
FontManager
- Inherited Members
Constructors
FontManager(IFontManagerImpl)
public FontManager(IFontManagerImpl platformImpl)
Parameters
platformImpl
IFontManagerImpl
Fields
CompositeFontScheme
public const string CompositeFontScheme = "compositefont"
Field Value
FontCollectionScheme
public const string FontCollectionScheme = "fonts"
Field Value
SystemFontScheme
public const string SystemFontScheme = "systemfont"
Field Value
Properties
Current
Get the current font manager instance.
public static FontManager Current { get; }
Property Value
DefaultFontFamily
Gets the system's default font family.
public FontFamily DefaultFontFamily { get; }
Property Value
SystemFonts
Get all system fonts.
public IFontCollection SystemFonts { get; }
Property Value
Methods
AddFontCollection(IFontCollection)
Add a font collection to the manager.
public void AddFontCollection(IFontCollection fontCollection)
Parameters
fontCollection
IFontCollectionThe font collection.
Remarks
If a font collection's key is already present the collection is replaced.
Exceptions
RemoveFontCollection(Uri)
Removes the font collection that corresponds to specified key.
public void RemoveFontCollection(Uri key)
Parameters
key
UriThe font collection's key.
TryGetGlyphTypeface(Typeface, out IGlyphTypeface?)
Tries to get a glyph typeface for specified typeface.
public bool TryGetGlyphTypeface(Typeface typeface, out IGlyphTypeface? glyphTypeface)
Parameters
typeface
TypefaceThe typeface.
glyphTypeface
IGlyphTypefaceThe created glyphTypeface
Returns
- bool
True
, if the FontManager could create the glyph typeface,False
otherwise.
TryMatchCharacter(int, FontStyle, FontWeight, FontStretch, FontFamily?, CultureInfo?, out Typeface)
Tries to match a specified character to a Typeface that supports specified font properties.
public bool TryMatchCharacter(int codepoint, FontStyle fontStyle, FontWeight fontWeight, FontStretch fontStretch, FontFamily? fontFamily, CultureInfo? culture, out Typeface typeface)
Parameters
codepoint
intThe codepoint to match against.
fontStyle
FontStyleThe font style.
fontWeight
FontWeightThe font weight.
fontStretch
FontStretchThe font stretch.
fontFamily
FontFamilyThe font family. This is optional and used for fallback lookup.
culture
CultureInfoThe culture.
typeface
TypefaceThe matching Typeface.
Returns
- bool
True
, if the FontManager could match the character to specified parameters,False
otherwise.