# preloadGoogleFont

> Bullet-proof browser preload for Google Fonts: 1) Fetches Google CSS 2) Parses every returned

```ts
const preloadGoogleFont: (fontFamily, options) => Promise<void> = loadGoogleFont2;
```

Bullet-proof browser preload for Google Fonts:
1) Fetches Google CSS
2) Parses every returned

## Parameters

| Parameter | Type |
| ------ | ------ |
| `fontFamily` | `string` |
| `options` | [`LoadGoogleFontOptions`](/docs/api/type-aliases/LoadGoogleFontOptions) |

## Returns

`Promise`\<`void`\>

## Font-face

3) Loads each selected .woff2 via FontFace.load()
4) 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.

Source: https://captionsjs.dev/docs/api/variables/preloadGoogleFont
