PeachDrawing.Text

PeachDrawing.Text.FontSet

FontSet.MatchOrFallback(string, TypefaceQuery) Method

Finds the best face of a family for a query, with a last resort for a family the set does not have.

public PeachDrawing.Text.TypefaceMatch MatchOrFallback(string familyName, in PeachDrawing.Text.TypefaceQuery query);

Parameters

familyName System.String

The family name.

query TypefaceQuery

What is wanted; its MustCover has to be null.

Returns

TypefaceMatch

Exceptions

System.ArgumentException
The query names a character to cover, or its weight, width percentage or oblique angle is not a finite number.

System.InvalidOperationException
The set holds no font at all, installed or added, or the face that matched is not a font this library can parse: a font is read in full when it is first matched and not when it is added.

Remarks

This never fails for a set that holds a font: a family name the set does not know is answered with a face of the set’s first family, which is what a renderer needs when even its default font is missing. To learn that a family is missing, or to require a character to be covered, use TryFindFamily(string, TypefaceFamily) and TryMatch(TypefaceQuery, TypefaceMatch).