# Variable: loadWebFont

> `const` **loadWebFont**: `object`

**`Advanced`**

A loader plugin for handling web fonts

The asset alias identifies the font in [Assets](assets.Assets.html.md); it is not the CSS font
family. Use the `data.family` value (or the loaded `FontFace.family`) as the
`fontFamily` in a text style. Without `data.family`, the family is derived
from the font file name.

## Type Declaration

### extension

> **extension**: `object`

#### extension.priority

> **priority**: [`LoaderParserPriority`](assets.LoaderParserPriority.html.md) = `LoaderParserPriority.Low`

#### extension.type

> **type**: [`LoadParser`](extensions.ExtensionType.html#loadparser) = `ExtensionType.LoadParser`

### id

> **id**: `string` = `'web-font'`

### name

> **name**: `string` = `'loadWebFont'`

used for deprecation purposes

### load()

> **load**(`url`, `options?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FontFace`](https://developer.mozilla.org/docs/Web/API/FontFace) \| [`FontFace`](https://developer.mozilla.org/docs/Web/API/FontFace)[]\>

#### Parameters

##### url

`string`

##### options?

[`ResolvedAsset`](assets.ResolvedAsset.html.md)\<[`LoadFontData`](assets.LoadFontData.html.md)\>

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FontFace`](https://developer.mozilla.org/docs/Web/API/FontFace) \| [`FontFace`](https://developer.mozilla.org/docs/Web/API/FontFace)[]\>

### test()

> **test**(`url`): `boolean`

#### Parameters

##### url

`string`

#### Returns

`boolean`

### unload()

> **unload**(`font`): `void`

#### Parameters

##### font

[`FontFace`](https://developer.mozilla.org/docs/Web/API/FontFace) | [`FontFace`](https://developer.mozilla.org/docs/Web/API/FontFace)[]

#### Returns

`void`

## Example

```ts
import { Assets, Text } from 'pixi.js';

await Assets.load({
  alias: 'font',
  src: 'fonts/titan-one.woff',
  data: { family: 'Titan One' },
});

const text = new Text({ text: 'Hello', style: { fontFamily: 'Titan One' } });
```
