# FontHandlerCollection

## Content

[**DsPdfJS API v9.1.3**](../README)

***

[DsPdfJS API](../globals) / FontHandlerCollection

# Class: FontHandlerCollection

Represents a collection of [FontHandler](FontHandler) objects.

## Extends

- `PdfKeyedObjectCollection`\<[`Font`](Font), [`FontHandler`](FontHandler)\>

## Accessors

### count

#### Get Signature

> **get** **count**(): `number`

Gets the number of items in the map.

##### Returns

`number`

#### Overrides

`PdfKeyedObjectCollection.count`

***

### id

#### Get Signature

> **get** **id**(): `number`

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

`PdfKeyedObjectCollection.id`

***

### last

#### Get Signature

> **get** **last**(): `TItem` \| `null`

Gets last item in the collection.

##### Returns

`TItem` \| `null`

#### Inherited from

`PdfKeyedObjectCollection.last`

***

### om

#### Get Signature

> **get** **om**(): [`ObjectManager`](ObjectManager)

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

`PdfKeyedObjectCollection.om`

## Methods

### add()

> **add**(`item`): `void`

Adds an item to the end of the collection.

#### Parameters

##### item

[`FontHandler`](FontHandler)

The item to add.

#### Returns

`void`

#### Inherited from

`PdfKeyedObjectCollection.add`

***

### clear()

> **clear**(): `void`

Clears the collection.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.clear`

***

### contains()

> **contains**(`item`): `boolean`

Determines whether the item is in the collection.

#### Parameters

##### item

[`FontHandler`](FontHandler)

#### Returns

`boolean`

true if the item is in the collection, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.contains`

***

### containsKey()

> **containsKey**(`key`): `boolean`

Determines whether the item with specified key exists in the collection.

#### Parameters

##### key

[`Font`](Font)

#### Returns

`boolean`

true if the item with the specified key exists in the collection, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.containsKey`

***

### free()

> **free**(): `void`

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

`PdfKeyedObjectCollection.free`

***

### get()

> **get**(`key`): [`FontHandler`](FontHandler) \| `undefined`

Gets the item with the specified key.

#### Parameters

##### key

[`Font`](Font)

#### Returns

[`FontHandler`](FontHandler) \| `undefined`

#### Overrides

`PdfKeyedObjectCollection.get`

***

### getAt()

> **getAt**(`index`): [`FontHandler`](FontHandler)

Gets the item with the specified index.

#### Parameters

##### index

`number`

The index of the item.

#### Returns

[`FontHandler`](FontHandler)

#### Overrides

`PdfKeyedObjectCollection.getAt`

***

### getFontHandler()

> **getFontHandler**(`font`): [`FontHandler`](FontHandler)

Gets an existing [FontHandler](FontHandler) associated with a specified [Font](Font),
or creates a new one if such font does not exist.

#### Parameters

##### font

[`Font`](Font)

The font

#### Returns

[`FontHandler`](FontHandler)

The existing or newly created [FontHandler](FontHandler).

***

### insert()

> **insert**(`index`, `item`): `void`

Inserts an item at a specific position in the collection.

#### Parameters

##### index

`number`

The position where the item will be inserted.

##### item

[`FontHandler`](FontHandler)

The item to insert.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.insert`

***

### rebind()

> **rebind**(`omTo`): `void`

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

`PdfKeyedObjectCollection.rebind`

***

### remove()

> **remove**(`item`): `boolean`

Removes the specified item from the collection.

#### Parameters

##### item

[`FontHandler`](FontHandler)

The item to remove.

#### Returns

`boolean`

true if the item was actually removed, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.remove`

***

### removeAt()

> **removeAt**(`index`): `void`

Removes the item at specified index.

#### Parameters

##### index

`number`

The index of the item to remove.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.removeAt`

***

### removeByKey()

> **removeByKey**(`key`): `boolean`

Removes the item with specified key from the collection.

#### Parameters

##### key

[`Font`](Font)

The key to remove.

#### Returns

`boolean`

true if the item with specified key was actually removed, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.removeByKey`

***

### setAt()

> **setAt**(`index`, `item`): `void`

Sets the item at the specified index.

#### Parameters

##### index

`number`

The index of the item, starting from 0.

##### item

[`FontHandler`](FontHandler)

The object to set.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.setAt`
