API ReferenceVariables
preloadGoogleFont
Bullet-proof browser preload for Google Fonts: 1) Fetches Google CSS 2) Parses every returned
const preloadGoogleFont: (fontFamily, options) => Promise<void> = loadGoogleFont2;Bullet-proof browser preload for Google Fonts:
- Fetches Google CSS
- Parses every returned
Parameters
| Parameter | Type |
|---|---|
fontFamily | string |
options | LoadGoogleFontOptions |
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.
For AI agents and LLMs: this page as Markdown · llms.txt · all docs in one file