# FontRegistry.registerCustomFont()

```ts
registerCustomFont(font: CustomFont & { ttfBytes: Uint8Array }): void
```

Adds a font from TTF/OTF bytes.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `font` | `CustomFont & { ttfBytes: Uint8Array }` | `{ id, displayName, ttfBytes, category?, cssFallback? }` — the same bag as a [fonts.customFonts](https://kernstra.com/docs/web-sdk/config/fonts/customfonts) entry. `category` defaults to `'sans-serif'`; `cssFallback` to the display name, then `sans-serif`. |

Returns `void`

```ts
const ttfBytes = new Uint8Array(await (await fetch('/fonts/brand.ttf')).arrayBuffer());
fonts.registerCustomFont({ id: 'brand', displayName: 'Brand Sans', ttfBytes, category: 'sans-serif' });
```

Part of [FontRegistry](https://kernstra.com/docs/web-sdk/api/fontregistry) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/fontregistry/registercustomfont
