avatarDaniele Quero, PhD

Summary

The web content provides a tutorial on how to import and use custom TrueType Fonts (TTF) in Unity's Text Mesh Pro (TMP) for enhanced text styling and effects.

Abstract

The article titled "Unity Text Mesh Pro (TMP) Font Asset Creator" is a guide for Unity developers looking to utilize advanced text features in their projects. It introduces Text Mesh Pro as a superior alternative to the old UI Text, emphasizing its extensive capabilities such as text styling, overflow options like linked overflow, and the ability to apply colors, gradients, textures, shadows, and lighting effects. The core focus of the tutorial is to address the challenge of using custom TTF fonts with TMP. It walks readers through the process of importing essential TMP packages, using the Font Asset Creator tool to generate Signed Distance Field (SDF) font assets from TTF files, and applying these assets to TMP objects. The article concludes with a call to action for readers to support the author by joining Medium through their referral link and subscribing to their newsletter for updates on new content.

Opinions

  • The author expresses that Text Mesh Pro (TMP) is a significant improvement over the old UI Text in Unity, suggesting it pushes text capabilities to the limit.
  • The author acknowledges the complexity of TMP by stating that demonstrating all its features would be a "humongous deed," implying that TMP is feature-rich and extensive.
  • The author indicates that the inability to use TTF fonts directly in TMP, unlike with the old Text system, could be seen as an "annoying issue," but provides a solution through the Font Asset Creator tool.
  • The author encourages the import of all suggested TMP-related packages, indicating that they may come in handy, showing a positive view of these resources.
  • The author promotes the use of HTML code within TMP for further text customization, suggesting it as an advantageous feature for developers.
  • The author suggests that readers can support them financially by becoming Medium members through their referral link, which also provides full access to Medium content.
  • The author invites readers to subscribe to their newsletter for notifications about new posts, indicating a desire to build a community or reader base.

How to Unity

Unity Text Mesh Pro (TMP) Font Asset Creator

Learn how to import new fonts for your Text Mesh Pro Objects

Text Mesh Pro (TMP) is a giant leap forward with respect to the plain old UI Text in Unity. It is such a big leap that in recent Unity versions it is not possible anymore to use the old Text.

Create a TMP (Text Mesh Pro) UI text object in Unity

Every first time you create a TMP, this pop-up suggests you import a bunch of related assets. Do it.

Import all these packages since they may come in handy

In this tutorial, I don’t dare to show you the capabilities of the Text Mesh Pro: it would be a humongous deed.

A lot of new features and Properties with the TMP — Text Mesh Pro
Linked Overflow will overflow a text into another one

Text Mesh Pro takes the UI Text and pushes it to the limit with text styling, new ways of overflowing the text (such as the cool linked overflow), improved use of colours, gradients and even textures applied to the Text, including shadow and lighting effects…

Use HTML code to style the text

You can also write HTML in the text input for even further customization of your text!

In this article, I aim to help you with one of the most annoying “issues” related to the Text Mesh Pro. Unlike the old Text, it is not possible anymore to you our beloved collection of TTF (True Type Font) fonts. This is mainly because the Text Mesh Pro uses a whole asset, carrying much more information (there even are materials for the text!).

What if you have a perfect TTF you want to use in my Unity project absolutely, but can’t because the TMP doesn’t accept it?

Go to Window → Package Manager and ensure the Text Mesh Pro package is installed. Then again Window → Text Mesh Pro Font Asset Creator

Open the Font Asset Creator in Unity

The Font Asset Creator is a tool that easily helps you in the creation of a font asset, starting from your favourite TTF.

Font Asset Creator:on the left, just opened; on the right, after generating Font Atlas

Make sure you have your TTF font in one of your project folders. In the dialog, drag your TTF into the Source Font File property and click on Generate Font Atlas. When it’s done, click on save and place the new file somewhere you like in the project. Now you have a font asset!

Attach your newly created font asset to the TMP

The font assets are SDF files, ready to be used with your TMP asset! Just drag and drop it on the specific property in the inspector and you’re good to go!

Enjoy your text!

If you liked the article, please clap to it and share it! Also, take a look at my games!

Get access to my stories and those of other Medium writers for just $5 a month. With no additional cost to you, I will receive half of your payments as a commission: it’s a great way to support me!

Join my newsletter and receive regular notifications when I post.

Unity
Unity Ui
Unity Game Development
Recommended from ReadMedium