Table of Contents

Class SystemFontFallback

Namespace
Egami.Fonts.Shaping
Assembly
Egami.Fonts.dll

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

collection FontCollection

The fonts to resolve from.

Exceptions

ArgumentNullException

collection is null.

Properties

Instance

Gets the resolver over System.

public static SystemFontFallback Instance { get; }

Property Value

SystemFontFallback

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

cluster ReadOnlySpan<char>

The grapheme cluster's text.

script Script

The script of the run the cluster is in.

language string

The BCP 47 language tag of the cluster, or null.

style FontStyle

The style of the font being shaped.

typeface Typeface

The face found.

Returns

bool

Whether a face was found.