Is there a way to preload the Material Icons font in advance?
<link rel="preload" href="https://fonts.gstatic.com/s/materialicons/v125/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2" as="font" type="font/woff2" crossorigin="anonymous">
It seems to be effective!
However, the issue arises when the filename includes a hash or UUID like:
v125/flUhRq6tzZclQEJ-Vdg-IuiaDsNc
. This means that if Google releases a new version with a different filename such as v126/sjboabchdiamblq-Abf-abvichef
, then the preload won't work.
To provide more context, I am utilizing their CDN using this method:
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
This retrieves the following CSS:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v125/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
[...]
}
Note: I am working within Angular and aiming for the font loading process to commence immediately without waiting for the application to load. Even though the CSS file loads promptly, the font itself does not initiate loading until a Material Icon is displayed.