Class FontFallback
Where characters the font does not map go: the caller's font families first, matched to the font's style, then a resolver. Without fallback (None, the default) shaping depends only on the fonts passed, never on the machine. A fallback face is drawn with the font's settings (hinting, metrics, embedded bitmaps, edging, emboldening and the rest) but its own default palette, as GDI+ font linking draws a linked face, bitmaps included.
public sealed class FontFallback
- Inheritance
-
FontFallback
- 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
FontFallback(IEnumerable<FontFamily>, IFontFallbackResolver?)
Initializes a fallback list.
public FontFallback(IEnumerable<FontFamily> families, IFontFallbackResolver? resolver = null)
Parameters
familiesIEnumerable<FontFamily>The families to try, in order, each matched to the style of the font being shaped.
resolverIFontFallbackResolverThe resolver tried after the families, or null.
Exceptions
- ArgumentNullException
familiesis null or holds null.
Properties
Families
Gets the families tried, in order.
public IReadOnlyList<FontFamily> Families { get; }
Property Value
None
Gets no fallback: characters the font lacks become its .notdef glyph.
public static FontFallback None { get; }
Property Value
Resolver
Gets the resolver tried after the families, or null.
public IFontFallbackResolver? Resolver { get; }
Property Value
System
Gets fallback to the installed fonts (SystemFontFallback): fixed per-system, per-script family lists, then any installed face that maps the characters. Output then depends on the machine's fonts.
public static FontFallback System { get; }