setPreloadFonts()

Sets the list of fonts that are preloaded when the widget is displayed on a site. Use this function to ensure that a widget based on a custom element has access to the required font styles.

This function can only be called from the code in a settings panel.

Note: Calling this function overwrites any fonts that were previously set to be preloaded. This means that any fonts not included in the current call will no longer be preloaded. Make sure to pass all the fonts that need to be preloaded every time you call the function.

Syntax

Copy

Parameters

NameTypeDescription
fontsArray of stringsCSS font shorthand strings defining the font styles to preload.

Returns

Promise<void>

Example

Copy
Did this help?