How to use a CUSTOM FONT with TEXT MESH PRO in Unity

In this article we see how to import a custom font in Unity and how to create the TMP Font Asset using the Font Asset Creator, this allows you to change the font style of a Text Mesh Pro text in Unity.

There is a video tutorial on this topic:




Which Font format to use in Unity

Fully supported formats for custom fonts and Text Mesh PRO are:

TrueType Fonts (.ttf)

OpenType Fonts (.otf)

Other Formats: While Text Mesh Pro does not directly support other formats like Web Open Font Format (.woff / .woff2), you can convert these into .ttf or .otf if needed before importing them into Unity.

Procedure to use custom fonts with Text Mesh PRO in Unity

First of all you will need to import the font files in your Unity project, you can do that by taking the font files and dragging to a folder inside Assets.

To use custom fonts with Text Mesh Pro you need to generate a font atlas, which is done through the Font Asset Creator in Unity.

This process involves creating a texture atlas with the characters from the font file, which is then used by Text Mesh Pro for rendering text smoothly at various sizes.

To generate the font atlas in Unity go to the Window tab, then to TextMesh Pro and then Font Asset Creator, as you can see in the following image.

how to open the font asset creator in Unity that allows you to apply a custom font to text mesh pro texts

In the Font Asset Creator window you have a field called “Source Font” where you can drag your font file.

Once you drag the font you click on “Generate Font Atlas”.

The process will take a momento, when it’s done you save the file in your project folder.

The resulting Asset is a file that you can drag and drop it in to the font field from any TextMesh PRO component in the inspector. That will apply the custom font to your text

Where to find Fonts to download

You can get Font files from different websites like DaFont or 1001Fonts.

You have reach the end of the article, if it was useful consider subscribing to the channel!

Exit mobile version
Secured By miniOrange