Skip to content

Function: resolveDrawnFontURL() ​

ts
function resolveDrawnFontURL(family, weight?, style?): string | undefined;

Experimental

The font file troika draws a request with: the registered face's URL, else the built-in default font's face once loaded (loadDefaultFontFaces). While that face has not loaded (or failed to), the closest built-in face that has loaded stands in, so troika never falls back to its CDN font for a whole label (the text primitive waits for the faces it needs, so this only covers empty labels and failed loads). undefined means "troika's default font": the app's defaultFontURL, or no built-in face loaded yet.

Parameters ​

ParameterType
familystring
weight?TextFontWeight
style?TextFontStyle

Returns ​

string | undefined

Released under the MIT License.