Variable: preloadGoogleFont()
constpreloadGoogleFont: (fontFamily,options) =>Promise<void> =loadGoogleFont2
Defined in: fonts/googleFonts.helpers.ts:259
Bullet-proof browser preload for Google Fonts:
- Fetches Google CSS
- Parses every returned
Parameters
fontFamily
string
options
Returns
Promise<void>
Font-face
- Loads each selected .woff2 via FontFace.load()
- Registers in document.fonts
If the exact requested weights are not available for the family (Google Fonts CSS2 API responds with 400 in that case, e.g. "PT Sans" + 900 or "Pacifico" + 500), falls back to loading 400/700 so the family is still registered and the canvas can resolve the closest available weight.