Skip to content

TextMeshPro Font Asset Creation & Packaging Guide

ManlyMarco edited this page Jun 10, 2026 · 3 revisions

This is a guide on how to create a new font asset bundle. If you want to know how to use a font asset bundle in game, see the "Font overriding" section in the readme.

This guide is based on a post by vbnshi. Check the original post for a Chinese version. They also posted a video version of this guide on bilibili.

Note: This was generated from the original post with a local LLM. While it was checked it may still contain inconsistencies. If in doubt, reference the original guide.

Table of Contents

  1. Prerequisites
  2. Create a TextMeshPro Font Asset
  3. Test the Generated SDF Atlas
  4. Package the Asset into an AssetBundle
  5. Assign the AssetBundle to the Font Asset
  6. Build the AssetBundle
  7. Troubleshooting
  8. Ready-to-Use Font Files

Prerequisites

This guide assumes that the target game is built in Unity 6.0. If it runs on a different Unity version, you must create the font asset with that same version, otherwise the asset may be incompatible.

Item Version / Requirement
Unity Hub Latest
Unity Editor 6000 (or the exact Unity version used by the target game)
TextMeshPro Comes with Unity 6000; will be imported automatically
TTF Font File Any TrueType font you wish to convert (e.g., arialuni.ttf)
Basic Unity knowledge Creating a project, navigating the UI, etc.

Create a TextMeshPro Font Asset

1. Start a new project

Open Unity HubInstall → select Unity 6000 → click Install. After installation, click New → give the project a name → Create.

2. Import TextMeshPro

In the Hierarchy window, right-click on empty space → 3D ObjectText - TextMeshPro. The TMP Importer dialog appears. Click both “Import TMP Essential Resources” and “Import TMP Examples & Extras” buttons.

3. Add your TTF font to the project

Drag the .ttf file from Explorer into the Assets folder in Unity.

4. Open the Font Asset Creator

In the top menu bar: Window → TextMeshPro → Font Asset Creator.

5. Configure the creation parameters

Parameter Recommended Setting Remarks
Source Font Drag your TTF file here
Sampling Point Size Auto Sizing
Padding 3 (or 5 if you see missing glyphs)
Packing Method Fast
Atlas Resolution 8192 x 8192 Large enough for many characters
Character Set Unicode Range (Hex)
Unicode Ranges 0020-007E,00A0-00FF,2000-206F,3000-303F,3040-30FF,2600-26FF,FF00-FFEF,4E00-9FA5 Includes basic Latin, Latin-1 Supplement, punctuation, CJK symbols, Hiragana/Katakana, emojis, full-width punctuation, and common Chinese characters. Adjust to fit your needs.
Render Mode SDFAA or SDF (choose one) SDFAA gives slightly sharper edges at the cost of a larger atlas.

6. Generate

Press Generate Font Atlas. Unity creates a new SDF (or SDFAA) font asset under Assets.

Test the Generated SDF Atlas

  1. Drag the newly created font asset onto a TextMeshPro object in the scene.
  2. Type a variety of characters (including those you listed in the Unicode range).
  3. If you see missing glyph boxes (displayed as □□□), return to the Font Asset Creator and increase Padding or expand the Unicode ranges.

When the test looks correct, proceed to packaging.

Package the Asset into an AssetBundle

1. Create an Editor folder

In Assets, right-click → Show in Explorer (Windows) / Reveal in Finder (macOS). Inside the opened folder, create a new sub-folder named Editor.

2. Add the packaging script

Inside Editor, create a plain text file and rename it to TextAssetBundleBuilder.cs (ensure the extension is .cs). Paste the following code and save:

using System.IO;
using UnityEditor;

/// <summary>
/// Simple AssetBundle builder. Place this script inside an "Editor" folder.
/// </summary>
public static class TextAssetBundleBuilder
{
    [MenuItem("Vbntool/AssetsBundlePackage")]
    private static void BuildAllAssetBundles()
    {
        const string folderName = "AssetsBundlePackage";

        // Ensure the output folder exists
        if (!Directory.Exists(folderName))
            Directory.CreateDirectory(folderName);

        // Build the bundle for Windows Standalone (adjust BuildTarget if needed)
        BuildPipeline.BuildAssetBundles(
            folderName,
            BuildAssetBundleOptions.None,
            BuildTarget.StandaloneWindows);
    }
}

3. Refresh Unity

Return to Unity. The editor will recompile the script and may show a few loading windows.

Assign the AssetBundle to the Font Asset

  1. Select the SDF/SDFAA font asset you generated earlier in the Project window.
  2. In the Inspector, locate the AssetBundle field at the bottom right.
  3. Click the dropdown NoneNew....
  4. Type a name for the bundle, e.g., arialuni_sdf_6000, and press Enter.

The asset is now marked to be included in the bundle you will build.

Build the AssetBundle

  1. In the top menu bar, click Vbntool → AssetsBundlePackage (the menu item added by the script).
  2. Unity will display a progress bar. Wait until it finishes without errors.

The output folder AssetsBundlePackage appears next to your Unity project folder. Inside, you will find a file named exactly as the AssetBundle you set (e.g., arialuni_sdf_6000). This file is the ready-to-use TextMeshPro font asset bundle.

Troubleshooting

Symptom Possible Cause Fix
Missing glyphs (□□□) Padding too low, Unicode range incomplete, or atlas resolution too small. Increase Padding to 5, add missing Unicode ranges, or raise Atlas Resolution.
No text appears at all (blank) AssetBundle built with a Unity version that differs from the target game's version. Re-create the font asset using the exact Unity version the game runs on.
Font still shows □□□ after bundling The font asset was not correctly assigned to the AssetBundle, or the bundle wasn’t rebuilt. Verify the AssetBundle name in the Inspector, then re-run Vbntool → AssetsBundlePackage.
XUnity.AutoTranslator does not pick up the font Config entries missing or wrong. Add the following lines to your AutoTranslator config: EnableTextMeshPro=True, and OverrideFontTextMeshPro=arialuni_sdf_6000 or FallbackFontTextMeshPro=arialuni_sdf_6000 (adjust the name if you used a different bundle name).
Need additional language support The provided bundles only contain Japanese, Chinese, English, basic symbols, and Chinese punctuation. Create a new font asset following the steps above, specifying the extra Unicode blocks you need.

Ready-to-Use Font Files

If you simply want a pre-built font bundle for the most common characters, look here:

Final Remarks

  • The process described here is fully editor-side; you do not need to write any runtime code to load the font.
  • Always keep the Unity version consistent between creation and the target game to avoid compatibility problems.
  • When working with large atlases (8192 × 8192), expect longer import times and larger bundle files. Adjust resolution according to the number of glyphs you truly need.