Table of Contents

Interface IFontFallbackResolver

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

Finds a face for a grapheme cluster no listed font maps, such as SystemFontFallback.

public interface IFontFallbackResolver

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

Methods

TryResolve(ReadOnlySpan<char>, Script, string?, FontStyle, out Typeface?)

Finds a face that maps every character of a cluster.

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.