# Font

### Description

Represents a font atlas.\
**Force** has a very limited API with **Font**'s because it still ~~BETA~~ ([2025.b1](/force/other/updates/force-2025.b1-preview-2.md)), so you can use **Font** only to set it to some [Text ](/force/force-scripting-api/force/text.md)component and access as read-only for properties of font atlas.

### Properties

|                                                      |                                                                                                             |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">channels</mark>             | Count of `channels` of out font texture. `3` == **RGB8**, `4` == **RGBA8**. \[Read Only]                    |
| <mark style="color:red;">pixelRange</mark>           | The pixel component of the total distance range of the font atlas. \[Read Only]                             |
| <mark style="color:red;">miterLimit</mark>           | The `miterLimit` for bounds computation of the font atlas. \[Read Only]                                     |
| <mark style="color:red;">padding</mark>              | The `padding` between glyph boxes of the font atlas. \[Read Only]                                           |
| <mark style="color:red;">packerScale</mark>          | The fixed `glyphScale` during font packing to font atlas texture. \[Read Only]                              |
| <mark style="color:red;">angleThreshold</mark>       | Coloring `angleThreshold` of font atlas texture. \[Read Only]                                               |
| <mark style="color:red;">isPreprocessGeometry</mark> | Should geometry of font atlas be a `preprocessed` during build font atlas? \[Read Only]                     |
| <mark style="color:red;">isKerningEnabled</mark>     | Should this font atlas build with `kerningEnabled`? \[Read Only]                                            |
| <mark style="color:red;">useExpensiveColoring</mark> | Should this font atals build with `expensiveColoring`? This depends on the channels of atlas. \[Read Only]. |

### Inherited Properties

|                                      |                        |
| ------------------------------------ | ---------------------- |
| <mark style="color:red;">name</mark> | `Name` of this object. |

### Constructors

|                                      |                                                                                                                             |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">Font</mark> | Construct the new <mark style="color:red;">Font</mark> without [Asset](/force/force-scripting-api/force/asset.md) attached. |

### Methods

|                                          |                                                                      |
| ---------------------------------------- | -------------------------------------------------------------------- |
| <mark style="color:red;">ToString</mark> | The `string` representation of <mark style="color:red;">Font</mark>. |
| <mark style="color:red;">GetAsset</mark> | Returns the font [asset](/force/force-scripting-api/force/asset.md). |

### Inherited Methods

|                                             |                                                                                                                                                                                                                         |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">GetObjectID</mark> | Returns the `ID` of current object. `ID` is unique only per one runtime session. Each sessions of runtime/play mode will change the `ID` of object. Not recommend equal object by `ID` if this not one runtime session. |

### Static Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                                                                                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">Destroy</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | <p>Destroyes <a href="/pages/lnKNpA07lSCwwGBwvYVk">Component</a> or <a href="/pages/RgPcKsgOwoZ54uyhf5m1">GameObject</a> or <a href="/pages/A6KLBbZMUWptc55UJB7H">Asset</a>. If Component, GameObject, Asset is null this method does nothing.</p><p> |
| <br>If obj is type of <strong>GameObject</strong> it will be destoryed after <code>OnUpdate()</code> loop is finished. If object attached to <a href="/pages/YVeHOrJwgOW0KZSDtWsp">MonoScript</a>, object calls <code>OnDestroy()</code> method to free all user resources, detach object from script and remove all components. If <strong>GameObject</strong> is null this method does nothing.<br><br>If obj is type of <strong>Component</strong> then immediately detach Component from assisated instance of <strong>GameObject</strong>. If component is <strong>MonoScript</strong>, object calls <code>OnDestroy()</code> method-event to free all user resources. If <strong>Component</strong> is null this method does nothing.</p><p></p><p>If obj is type of <strong>Asset</strong> (<a href="/pages/0iRoPs8xJeotJiM8ozvS">Texture2D</a>, <a href="/pages/y6Px0Wow8zSLNzKDqQNB">AudioClip</a>, <a href="/pages/UZTxKKIMnDNqheFRq6Ok">Font</a>, etc) it immidiatly removes it if possible.</p> |                                                                                                                                                                                                                                                       |

### See Also

[Text](/force/force-scripting-api/force/text.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/font.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
