Skip to content

Function: resolveFontFace() ​

ts
function resolveFontFace(family, weight?, style?): ResolvedFontFace | undefined;

Resolve a CSS family list to a registered face: the first registered family in the list wins, then the best face by style (exact, else the other style) and weight (fontWeightRank). Returns undefined when no family is registered, meaning "use the default font" (see resolveDrawnFontURL).

Parameters ​

ParameterType
familystring
weight?TextFontWeight
style?TextFontStyle

Returns ​

ResolvedFontFace | undefined

Released under the MIT License.