Get Your Personalized Game Dev Plan Tailored tips, tools, and next steps - just for you.

Text Mesh Pro in Unity: Font Import Guide

Posted by Gemma Ellison
./
May 26, 2023
The cover for Text Mesh Pro in Unity: Font Import Guide

What you will learn

This tutorial will cover the difference between Text Mesh Pro fonts and standard fonts in Unity. Then, this tutorial will explain how to import a font to Unity to use it with Text Mesh Pro. Finally, it will provide recommendations for where you can find custom fonts that you can add to Unity.

TL;DR

What is the difference between TMP Fonts and standard Unity fonts?

TMP fonts are better; use them.

How to Import a TMP Font

It is easy to import a Text Mesh Pro-compatible font. Here’s how:

  1. Import the .ttf or .otf file to your project
  2. Select the font file
  3. Press CTRL + SHIFT + F12 to create a new font asset
  4. Open the font asset
  5. Click Update Atlas Texture
  6. Change the Character Set
  7. Click Generate Font Atlas
  8. Assign the font to a TMP component.

Where to find custom fonts

You can download TMP-compatible fonts from the Unity Store or from Google Fonts.

Discover the Power of Text Mesh Pro Fonts in Unity

In Unity, choosing the right fonts for your project can have a significant impact on the visual appeal and readability of your text. While Unity’s default text renderer gets the job done, it may not provide the level of quality and versatility you desire.

That’s where Text Mesh Pro (TMP) comes in. TMP is an alternative text renderer in Unity that offers enhanced visual fidelity and advanced features for creating better text elements in your games or applications, especially compared to standard Unity fonts.

In this tutorial, we will explore the differences between Text Mesh Pro fonts and standard fonts in Unity, and explain why Text Mesh Pro is often the preferred choice. We’ll walk you through the process of importing a font into Unity and using it with Text Mesh Pro so that you can use this text rendering solution.

Additionally, we’ll provide recommendations on where to find custom fonts to add a unique touch to your Unity projects.

Whether you’re a game developer, UI designer, or simply interested in optimizing text rendering in Unity, this tutorial will equip you with the knowledge and tools to improve the visual impact of your text elements.

Text Mesh Pro Fonts vs. Standard Fonts vs. Unity fonts

Most fonts are stored in one of several formats: TrueType (.ttf), OpenType (.otf), and Web Open Font Format (.woff / .woff2). Under the hood, formats like TrueType describe each character using a series of line segments and curves - not pixels. In this context, a character is called a glyph.

Unity includes a text renderer by default (i.e., “Unity Fonts”), but it doesn’t look good and offers limited features. Unity’s default text renderer is directly compatible with TrueType and OpenType fonts.

You just drag and drop the font into the text renderer. Under the hood, Unity converts the font to a texture atlas and samples that texture atlas during rendering. Unity renders the character glyphs directly to the texture atlas, so the character glyph is scaled to a particular font resolution.

Text Mesh Pro is an alternative text renderer that looks much nicer. It is sometimes abbreviated as TMP. Text Mesh Pro is not directly compatible with these common font formats. Instead, Text Mesh Pro requires you to pre-generate an SDF font atlas, which is a special texture file that Text Mesh Pro can create using a standard font format - TrueType or OpenType.

Create a free account, or log in.

Gain access to free articles, game development tools, and game assets.