Class SystemFontFallback
The installed-font resolver of System: fixed families for each script on Windows, macOS and Linux (Segoe UI Emoji, Apple Color Emoji or Noto Color Emoji for emoji; the language picks Japanese, Chinese or Korean faces for Han), then any installed face that maps the cluster, found once and remembered for the process.
public sealed class SystemFontFallback : IFontFallbackResolver
- Inheritance
-
SystemFontFallback
- Implements
- Inherited Members
Examples
// Characters the font lacks: the caller's families first, then installed fonts only when asked for.
FontFallback mine = new(FontCollection.System.Families.Where(f => f.Name is "Segoe UI Emoji" or "Noto Color Emoji"));
FontFallback system = FontFallback.System; // depends on the machine's fonts
FontFallback none = FontFallback.None; // the default: missing characters draw as .notdef
Constructors
SystemFontFallback(FontCollection)
Initializes a resolver over a collection of fonts.
public SystemFontFallback(FontCollection collection)
Parameters
collectionFontCollectionThe fonts to resolve from.
Exceptions
- ArgumentNullException
collectionis null.
Properties
Instance
Gets the resolver over System.
public static SystemFontFallback Instance { get; }
Property Value
Methods
TryResolve(ReadOnlySpan<char>, Script, string?, FontStyle, out Typeface?)
Finds a face that maps every character of a cluster.
public bool TryResolve(ReadOnlySpan<char> cluster, Script script, string? language, FontStyle style, out Typeface? typeface)
Parameters
clusterReadOnlySpan<char>The grapheme cluster's text.
scriptScriptThe script of the run the cluster is in.
languagestringThe BCP 47 language tag of the cluster, or null.
styleFontStyleThe style of the font being shaped.
typefaceTypefaceThe face found.
Returns
- bool
Whether a face was found.