Text
Source font file

Many of these import options are remnants of the legacy text system in uGUI (Unity UI). There are plans to remove them in future releases. Rendering Mode, Character, and Include Font Data are used for generating the Font Asset.

Different UI systems use different font assets.
Font asset settings
-
Face Info: Spacing and scaling options for your font to adjust parameters that can better suit your application if the default source font required tweaks
-
Generation Settings: Essential configuration including the source font, the font face to use for the font asset in case the source font includes several styles, the atlas population mode, as well as the render modes
-
Atlas and Material: The material and texture generated; whether the atlas is static, dynamic, or has the rendering mode as bitmap or SDF; provides control of the size of atlas generated in the case of supporting languages with large character sets
-
Font Weights: Simulates different font weights when the source asset doesn't have such variations
-
Fallback Font Asset: Provides for a fallback font in cases where the current Font asset lacks a character or glyph
-
Character and Glyph Tables: A detailed list of all the characters and glyphs included in the font asset
-
Ligature table: For adding a glyph to be used when two characters are together (improves readability and visual flow)
-
Glyph Adjustments: Defines overrides per character or glyph

Source fonts and atlases can increase the build size: On the left is an atlas with ASCII characters and on the right is an atlas of a complete Unicode character set.
512 x 512Font asset variant
Rich text
<b></b>
Enable rich text tags in UI Builder to make the tags modify your visual text properties.
Gradients
<gradient>
Example of creating and applying a gradient to text in UI Toolkit
-
To create a gradient color asset, select Create > UI Toolkit > Text > Gradient Color. Make sure to place this file insideor any subfolder under Resources.
Assets/Resources -
Create a Text Settings asset to refer to from the Panel Settings. In the asset look for Color Gradient Presets, and indicate the folder or subfolder inside Resources where the asset is.
-
Add the following rich text tags inside UI Builder:.
<color=white><gradient="testColorGradient">Gradient Test</gradient></color> -
The color tag restores the font color to white so the gradient looks as intended, while the referred gradient has to match the asset name created in step 1. Make sure Rich Text is enabled.
-
You can see the changes take effect inside UI Builder or in the Game view.
Sprite asset and emojis

A common example showing emojis or icons integrated into text strings
-
Import the sprite or PSD file that contains the emojis or icons
-
Slice the image into multiple sprites. If you use a PSD file as described in the Graphic and font assets preparation section, you don't need to slice the image.
-
To generate the Sprite Asset, select the file and right-click Create > UI Toolkit > Text > Sprite Asset menu. Make sure the asset is placed underor a subfolder.
Assets/Resources -
You can adjust the Face Info and customize the appearance/names of each "glyph" in this new Sprite asset. Any changes here will replace the default Face Settings from the Font asset.
-
Select the Panel Settings from the UI Document.
-
Open the Text Settings asset (or create one, if there's none).
-
Link to the Sprite asset using the file browser in the Text Settings file. Save and enter Play mode for the updated settings to take effect.
<sprite index=0><sprite name="name">
Add a Sprite Asset to a text field in UI Toolkit using rich text tags: Make sure that the Enable Rich Text option is checked (top).

Example of using OS emojis with Apple Emoji font
- Create a Font asset from the font that your target system uses. On iOS the font is called Apple Emoji (used in this example), and on Android it's called Noto Color Emoji (currently only COLRv0 is supported). Make sure the Font Asset is of the type Color, and then set the atlas population mode to Dynamic OS which doesn't require you to include the source font in your asset, saving space.
- Ensure Clean Dynamic Data On Build is checked on the Font Asset.
- Enable Parse Escape Sequences on UI Builder and enter the desired emojis using the emoji keyboard from MacOS or Windows or in UTF format, for example, you would introduce a smiley as U0001F601. You can check the UTF of each emoji in the Character Table of the Font Asset.
- The build running on MacOS displays the emojis according to the OS font.
- We can observe that in our test, the build size is smaller than the standalone emoji font, proving that it was not included in the project but still being used to render the appropriate emojis.
Text Style Sheets
<style>
A reusable Text Style Sheet
-
A custom style can include opening and closing rich text tags, plus leading and trailing text.
-
You can conveniently update a text style sheet, especially when compared to directly changing rich text formatting.
-
Custom styles can reduce the amount of rich text tags. You can just use one tag,, that applies all the necessary styling.
<style= name> -
This makes it easier to change one rich text tag in a text style sheet, and is less error prone than manually changing multipletags.
<style>