Asset.font ViewHelper <vite:asset.font> 

The <vite:asset.font> ViewHelper allows to customize the preloading of fonts referenced by the entry point of the <vite:asset> ViewHelper, for example fonts used in CSS files. It can only be used as a direct child element of <vite:asset>.

By default, only fonts in the woff2 format are preloaded, as all current browsers support it. Other formats are usually only fallbacks for legacy browsers.

See <vite:asset> for more examples.

Example: Disable preloading of fonts 

<vite:asset entry="EXT:sitepackage/Resources/Private/JavaScript/Main.entry.js">
    <vite:asset.font preload="{false}" />
</vite:asset>
Copied!

Arguments

The following arguments are available for the asset.font ViewHelper:

formats

formats
Type
string
Default
'woff2'
Comma-separated list of file extensions that should be preloaded (default: woff2). If empty, all fonts are preloaded.

preload

preload
Type
bool
Default
true
Set to "false" if referenced fonts should not be preloaded.