# Class: BitmapFontManager

**`Advanced`**

The BitmapFontManager is a helper that exists to install and uninstall fonts
into the cache for BitmapText objects.

## Example

```ts
import { BitmapFontManager, BitmapText } from 'pixi.js';

BitmapFontManager.install({
  name: 'TitleFont',
  style: {}
});

const title = new BitmapText({ text: 'This is the title', style: { fontFamily: 'TitleFont' }});
```

## Properties

### ALPHA

> `readonly` `static` **ALPHA**: (`string` \| `string`[])[]

This character set includes all the letters in the alphabet (both lower- and upper- case).

#### Example

```ts
BitmapFont.from('ExampleFont', style, { chars: BitmapFont.ALPHA })
```

***

### ALPHANUMERIC

> `readonly` `static` **ALPHANUMERIC**: (`string` \| `string`[])[]

This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.

***

### ASCII

> `readonly` `static` **ASCII**: `string`[][]

This character set consists of all the ASCII table.

#### See

http://www.asciitable.com/

***

### defaultOptions

> `static` **defaultOptions**: [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)\<[`BitmapFontInstallOptions`](text.BitmapFontInstallOptions.html.md), `"style"`\>

Default options for installing a new BitmapFont.

***

### measureCache

> `readonly` `static` **measureCache**: `LRU`\<`BitmapTextLayoutData`\>

Cache for measured text layouts to avoid recalculating them multiple times.

***

### NUMERIC

> `readonly` `static` **NUMERIC**: `string`[][]

This character set includes all decimal digits (from 0 to 9).

#### Example

```ts
BitmapFont.from('ExampleFont', style, { chars: BitmapFont.NUMERIC })
```

## Methods

### getFont()

> `static` **getFont**(`text`, `style`): [`BitmapFont`](text.BitmapFont.html.md)

Get a font for the specified text and style.

#### Parameters

##### text

`string`

The text to get the font for

##### style

[`TextStyle`](text.TextStyle.html.md)

The style to use

#### Returns

[`BitmapFont`](text.BitmapFont.html.md)

***

### getLayout()

> `static` **getLayout**(`text`, `style`, `trimEnd`): `BitmapTextLayoutData`

Get the layout of a text for the specified style.

#### Parameters

##### text

`string`

The text to get the layout for

##### style

[`TextStyle`](text.TextStyle.html.md)

The style to use

##### trimEnd

`boolean` = `true`

Whether to ignore whitespaces at the end of each line

#### Returns

`BitmapTextLayoutData`

***

### install()

#### Call Signature

> `static` **install**(`options`): [`BitmapFont`](text.BitmapFont.html.md)

Generates a bitmap-font for the given style and character set

##### Parameters

###### options

[`BitmapFontInstallOptions`](text.BitmapFontInstallOptions.html.md)

Setup options for font generation.

##### Returns

[`BitmapFont`](text.BitmapFont.html.md)

Font generated by style options.

##### Example

```ts
import { BitmapFontManager, BitmapText } from 'pixi.js';

BitmapFontManager.install('TitleFont', {
    fontFamily: 'Arial',
    fontSize: 12,
    strokeThickness: 2,
    fill: 'purple',
});

const title = new BitmapText({ text: 'This is the title', fontFamily: 'TitleFont' });
```

#### Call Signature

> `static` **install**(`name`, `style?`, `options?`): [`BitmapFont`](text.BitmapFont.html.md)

##### Parameters

###### name

`string`

###### style?

[`TextStyle`](text.TextStyle.html.md) | [`TextStyleOptions`](text.TextStyleOptions.html.md)

###### options?

[`BitmapFontInstallOptions`](text.BitmapFontInstallOptions.html.md)

##### Returns

[`BitmapFont`](text.BitmapFont.html.md)

##### Deprecated

since 7.0.0

***

### measureText()

> `static` **measureText**(`text`, `style`, `trimEnd`): `object`

Measure the text using the specified style.

#### Parameters

##### text

`string`

The text to measure

##### style

[`TextStyle`](text.TextStyle.html.md)

The style to use

##### trimEnd

`boolean` = `true`

Whether to ignore whitespaces at the end of each line

#### Returns

`object`

##### height

> **height**: `number`

##### offsetY

> **offsetY**: `number`

##### scale

> **scale**: `number`

##### width

> **width**: `number`

***

### uninstall()

> `static` **uninstall**(`name`): `void`

Uninstalls a bitmap font from the cache.

#### Parameters

##### name

`string`

The name of the bitmap font to uninstall.

#### Returns

`void`
