MCPInstall

optimize-text-mesh-pro

Optimizes TextMeshPro rendering, memory, and font setup, including font asset stacks, fallback atlases, SDF quality, and worldspace text. Use when the user asks about TMP fonts, CJK or multilingual text, or text performance.

Installs
47
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/unity-technologies/unity-agent-plugin --skill optimize-text-mesh-pro
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads optimize-text-mesh-pro automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Optimize TextMeshPro

Triage — identify the symptom first

Before providing tips, identify which category the user's issue falls into. If the user has not described a specific symptom, ask: "Are you seeing a memory/atlas bloat, visual quality, CPU/performance, build size, or localization/alignment issue with TextMeshPro?"

SymptomGo To
Memory Profiler shows large or multiple TMP atlasesFont Stack & Dynamic Fallbacks, Memory Profiler: Include Font Data
Inconsistent glyph weight, fuzzy edges, visual qualityPadding & Sampling Ratios, Font Asset Scale, Atlas Render Mode: SDF16
CPU spikes during text updates or Canvas rebuildsAutoSize, Worldspace vs Canvas Text
Build size too large from shipped font filesDynamic OS Atlas Population
Mixed Latin + CJK alignment looks offFont Normalization
Need multiple font styles (italic, outline, glow)Material Presets

Core Rules

  • Main font = static asset with all glyphs baked in. Add dynamic fallbacks via the Fallback list (or TMP Settings) for everything else. Keep dynamic atlas size at 512-1024 to bound peak memory.
  • Dynamic fallback fonts -> enable Clear Dynamic Data On Build. Otherwise editor-baked glyphs ship in the player.
  • Keep Padding-to-Sampling-Point-Size ratio consistent across primary + fallback fonts. Mismatch produces inconsistent glyph weight on the same line.
  • Latin sampling point size 70-90; CJK 36-50. Different scripts need different sampling sizes for clean SDF.
  • Font asset Scale = 1. Anything else (e.g., 0.9) breaks standard point-size math.
  • Disable AutoSize at runtime once layout is locked. AutoSize is for design, not for live counters.
  • Worldspace text -> use TextMeshPro, not TextMeshProUGUI. Canvas overhead in worldspace is not free.
  • Parent often-changing TMP UI to its own Canvas to bound rebuild cost.
  • TMP material presets > duplicating font assets for italic / bold / outline / glow variants of the same font.
  • For shipping multilingual builds on iOS/Android, evaluate Atlas Population Mode = Dynamic OS (TMP 3.2.0-pre.3+) to leverage system fonts and shrink the build.

Font Stack & Dynamic Fallbacks

If the user reports memory bloat from TMP atlases, advise this font stack pattern:

Main font asset (static, all required Latin glyphs baked)
  -> Fallback 1: Dynamic font (atlas 512 or 1024) for CJK
  -> Fallback 2: Dynamic font for symbols / emoji

NEVER ship a dynamic fallback font asset without enabling Clear Dynamic Data On Build. Every glyph baked while testing in the editor is included in the player build if this toggle is off.


Padding & Sampling Ratios

If the user reports inconsistent stroke widths or glyph weight differences between primary and fallback fonts, check the padding-to-sampling-point-size ratio.

The ratio is Padding / SamplingPointSize. With Padding = 9 and Sampling Point Size = 90, ratio = 10%.

  • A primary font with one ratio and a fallback with a different ratio produces inconsistent stroke widths on the same line.
  • Pick a ratio (10% is a safe default), apply it to all font assets in the chain.

Recommended sampling point sizes:

  • Latin scripts: 70-90.
  • CJK scripts: 36-50 (CJK glyphs are visually denser; smaller sampling sizes still produce clean SDF and save atlas memory).

Font Asset Scale

If the user reports point sizes not matching design specs, check the font asset Scale value. Some imported TMP font assets ship with Scale = 0.9 instead of 1.0. The Scale value participates in the point-size-to-pixels math, so a non-1 scale produces non-standard point sizes. Advise the user to set Scale = 1 on all font assets before adjusting padding ratios.


Sprite Assets

If the user reports slow loading times for TMP Sprite Assets on mobile, check the source texture's Texture Type. It must be set to Default (not Sprite). Sprite type creates child sub-objects that TMP doesn't use; Default avoids them.


AutoSize

If the user reports CPU spikes on text fields that change frequently (timers, counters, chat, dynamic player names), check whether enableAutoSizing is on. AutoSize resizes the text whenever the string changes, causing constant CPU spikes.

Advise: disable AutoSize and hard-code the chosen point size once layout is locked. Keep AutoSize on only for genuinely static labels that auto-fit on locale change.


Atlas Render Mode: SDF16

If a static font with point size 72 or larger looks unclear or has fuzzy edges, advise switching the Atlas Render Mode to SDF16. Higher precision SDF for big glyphs, at slightly more atlas memory.


Font Normalization

If the user reports misaligned Latin + CJK text on the same line, walk them through this procedure:

  1. Window -> TextMeshPro -> Settings -> Import TMP Example & Extras (one-time per project).
  2. Add the TMP_TextInfoDebugTool component to the TextMeshPro object displaying misaligned text.
  3. Enable ShowLines toggle - the ascender, descender, and baseline render as overlays.
  4. Mix Latin + CJK strings; if the lines diverge, adjust ascender/descender on the TMP Font Asset until they align.

Caveat: importing TMP Examples & Extras has been observed to cause an infinite import loop on some project layouts. If it happens, close Unity and re-open - the import resolves on the second attempt.


Material Presets

If the user needs multiple styles (italic, bold, outline, glow) of the same font, advise material presets instead of duplicating font assets. Presets share the same font texture but override shader parameters.

How to create:

  1. Select a TMP Text GameObject.
  2. In Inspector, find the Material section.
  3. Right-click the Material header -> Create Material Preset.
  4. Rename the new material and tweak settings.
  5. On the TMP Text component, pick the preset from the Material Preset dropdown.

Dynamic OS Atlas Population (TMP 3.2.0-pre.3)

If the user is shipping multilingual builds and concerned about build size, advise evaluating Atlas Population Mode = Dynamic OS (TMP 3.2.0-pre.3+):

  • In Editor: still uses the source font from the project.
  • In a player build: the source font is not included. At runtime, Unity searches the device for a font with the matching Family + Style name.

Recommended system fonts for CJK:

PlatformRecommended system font
AndroidNotoSans (covers Chinese, Japanese, Korean glyphs broadly).
iOSPingFang for Simplified/Traditional Chinese. iOS uses unique fonts per language for CJK (different families for Chinese, Japanese, Korean) - check the fallback chain when shipping a single TMP setup across all three.

Wins: build size shrinks (no shipped CJK font files) and memory drops (system font is shared with the OS).


Memory Profiler: Include Font Data

If Memory Profiler shows unexpectedly large font asset sizes in the Editor, check whether Include Font Data is enabled on the .ttf / .ttc import settings. The Editor includes the source font file in the asset by default, but on device (especially with Dynamic OS), this cost is not paid.

To make Editor captures match device: on the font file -> deselect Include Font Data in the import settings. Memory Profiler will then show overhead without the underlying font file.


Worldspace vs Canvas Text

If the user has worldspace text (damage numbers, signs, holograms) using TextMeshProUGUI, advise switching to TextMeshPro. Worldspace Canvas is a known inefficiency.

If a TextMeshProUGUI element's text changes often (timers, counters, chat), advise parenting it under a child GameObject with its own Canvas component. Canvas rebuilds are scoped per-Canvas, so isolating the volatile field cuts rebuild cost on the rest of the UI.


Common Pitfalls

If the user's setup matches any of these, flag it:

  • One giant dynamic font asset for all languages instead of static main + dynamic fallback - the dynamic atlas balloons.
  • Inconsistent padding ratio across primary + fallback - same line of text looks like two fonts.
  • Font asset Scale = 0.9 inherited from import - point sizes won't match design specs.
  • Leaving AutoSize on for live counters - hidden CPU spikes.
  • World-space TextMeshProUGUI inside a worldspace Canvas - extra rebuilds for no benefit; use TextMeshPro.
  • Forgetting Clear Dynamic Data On Build on dynamic fallback fonts - editor-test glyphs ship in the player.
  • Capturing Memory Profiler in Editor with Include Font Data on, then being surprised the on-device build is smaller.
  • Sprite asset source texture set to Sprite type - mobile loading slows from extra child sub-objects.

References

FAQ

What does the optimize-text-mesh-pro skill do?

Optimizes TextMeshPro rendering, memory, and font setup, including font asset stacks, fallback atlases, SDF quality, and worldspace text. Use when the user asks about TMP fonts, CJK or multilingual text, or text performance.

How do I install optimize-text-mesh-pro?

Run npx skills add https://github.com/unity-technologies/unity-agent-plugin --skill optimize-text-mesh-pro in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/optimize-text-mesh-pro/ (personal) or .claude/skills/optimize-text-mesh-pro/ (project).

Which AI agents can use optimize-text-mesh-pro?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is optimize-text-mesh-pro safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains optimize-text-mesh-pro?

It is published by unity-technologies in unity-technologies/unity-agent-plugin. It has 47 recorded installs.

More from unity-technologies/unity-agent-plugin

View all →

unity-cli

unity-technologies/unity-agent-plugin

Controls the Unity Editor and projects from the command line, driving a running Editor to edit scenes and assets or run C. Use when asked to install or manage Editors, licenses, or projects, set up version control, build, test, configure the Unity MCP server, or run any unity command.

Backend & APIs54 installs

urp-postprocessing

unity-technologies/unity-agent-plugin

Sets up, configures, and debugs URP post-processing with the Volume framework. Use for bloom, tonemapping, color adjustments, depth of field, vignette, or other Volume overrides.

52 installs

ui-ugui

unity-technologies/unity-agent-plugin

Understands, edits, and generates Unity uGUI Canvas hierarchies, RectTransforms, Layout Groups, and prefab UI. Use for requests involving Canvas, uGUI, RectTransform, or prefab UI files.

unity-package-management

unity-technologies/unity-agent-plugin

Adds, removes, upgrades, and discovers Unity (UPM) packages from outside the Editor, with the Pipeline package commands first and a C script as the fallback. Use for package installs, verifying package IDs and versions, or choosing which packages a game needs.

Media & Creative51 installs

ui-uitk

unity-technologies/unity-agent-plugin

Open the skill to read its SKILL.md instructions.

localization

unity-technologies/unity-agent-plugin

Sets up and configures Unity Localization, including locales, String and Asset Tables, and CJK fonts. Use when the user asks to add languages, translate UI text, or mentions i18n or multilingual support.

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.