# Font

### Description

Represents a font atlas.\
**Force** has a very limited API with **Font**'s because it still ~~BETA~~ ([2025.b1](https://danil-dukhovenko.gitbook.io/force/other/updates/force-2025.b1-preview-2)), so you can use **Font** only to set it to some [Text ](https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/text)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](https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/asset) 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](https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/asset). |

### 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="component">Component</a> or <a href="gameobject">GameObject</a> or <a href="asset">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="monoscript">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="texture2d">Texture2D</a>, <a href="audioclip">AudioClip</a>, <a href="font">Font</a>, etc) it immidiatly removes it if possible.</p> |                                                                                                                                                                                              |

### See Also

[Text](https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/text)
