# FontHandler

## Content

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

***

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

# Class: FontHandler

Represents and manages a [Font](Font)
used in a [PdfDocument](PdfDocument).

## Extends

- [`ObjectBase`](ObjectBase)

## Accessors

### embedMode

#### Get Signature

> **get** **embedMode**(): [`FontEmbedMode`](../enumerations/FontEmbedMode) \| `null`

Gets or sets the font embedding mode.
By default this property is unspecified (null), and the actual embedding mode depends on 
whether or not the [Font](Font) is one of [StandardPdfFont](../enumerations/StandardPdfFont).
For standard fonts, [PdfDocument#standardFontEmbedMode](PdfDocument#standardfontembedmode) determines the embedding mode.
For all other fonts, [PdfDocument#fontEmbedMode](PdfDocument#fontembedmode) determines the embedding mode.

##### Returns

[`FontEmbedMode`](../enumerations/FontEmbedMode) \| `null`

#### Set Signature

> **set** **embedMode**(`value`): `void`

Gets or sets the font embedding mode.
By default this property is unspecified (null), and the actual embedding mode depends on 
whether or not the [Font](Font) is one of [StandardPdfFont](../enumerations/StandardPdfFont).
For standard fonts, [PdfDocument#standardFontEmbedMode](PdfDocument#standardfontembedmode) determines the embedding mode.
For all other fonts, [PdfDocument#fontEmbedMode](PdfDocument#fontembedmode) determines the embedding mode.

##### Parameters

###### value

[`FontEmbedMode`](../enumerations/FontEmbedMode) | `null`

##### Returns

`void`

***

### font

#### Get Signature

> **get** **font**(): [`Font`](Font)

Gets the [Font](Font) associated with this FontHandler.

##### Returns

[`Font`](Font)

***

### format

#### Set Signature

> **set** **format**(`value`): `void`

Gets or sets the format used to represent the font in a document.
If "null" (the default), [PdfDocument#pdfFontFormat](PdfDocument#pdffontformat) is used.
Note that this property does not affect the 14 standard PDF fonts,
those are always encoded as Type1.

##### Parameters

###### value

[`PdfFontFormat`](../enumerations/PdfFontFormat) | `null`

##### Returns

`void`

***

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ObjectBase`](ObjectBase).[`id`](ObjectBase#id)

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](ObjectBase#om)

***

### pdfFontFormat

#### Get Signature

> **get** **pdfFontFormat**(): [`PdfFontFormat`](../enumerations/PdfFontFormat) \| `null`

Gets or sets the format used to represent the font in a document.
If "null" (the default), [PdfDocument#pdfFontFormat](PdfDocument#pdffontformat) is used.
Note that this property does not affect the 14 standard PDF fonts,
those are always encoded as Type1.

##### Returns

[`PdfFontFormat`](../enumerations/PdfFontFormat) \| `null`

***

### usedInDocument

#### Get Signature

> **get** **usedInDocument**(): `boolean`

Gets a value indicating whether the current font is actually used in the document.

##### Returns

`boolean`

## Methods

### free()

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

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

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### 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

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
