npx skills add ...
npx skills add unity-technologies/skills --skill optimize-text-mesh-pro
Covers TextMeshPro font stacks, dynamic fallback atlases, padding and sampling ratios, SDF16, AutoSize discipline, worldspace vs UGUI, and Memory Profiler font-data capture. Use when the user mentions TextMeshPro, Text Mesh Pro, TMP (TextMeshPro), font asset, dynamic atlas, TMP localization, CJK (Chinese, Japanese, Korean) fonts, font alignment across scripts, mixed western and eastern fonts, text rendering performance, profiler markers related to text generation or glyph rasterization, font fallback strategy, font normalization, multilingual or localized text rendering, SDF font quality, or text-related memory issues—not for UI Toolkit layout (unity-ui-toolkit) or non-TMP uGUI (unity-ui).
npx skills add unity-technologies/skills --skill optimize-text-mesh-pro
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?"
| Symptom | Go To |
|---|---|
| Memory Profiler shows large or multiple TMP atlases | Font Stack & Dynamic Fallbacks, Memory Profiler: Include Font Data |
| Inconsistent glyph weight, fuzzy edges, visual quality | Padding & Sampling Ratios, Font Asset Scale, Atlas Render Mode: SDF16 |
| CPU spikes during text updates or Canvas rebuilds | AutoSize, Worldspace vs Canvas Text |
| Build size too large from shipped font files | Dynamic OS Atlas Population |
| Mixed Latin + CJK alignment looks off | Font Normalization |
| Need multiple font styles (italic, outline, glow) | Material Presets |
Clear Dynamic Data On Build. Otherwise editor-baked glyphs ship in the player.TextMeshPro, not TextMeshProUGUI. Canvas overhead in worldspace is not free.Atlas Population Mode = Dynamic OS (TMP 3.2.0-pre.3+) to leverage system fonts and shrink the build.If the user reports memory bloat from TMP atlases, advise this font stack pattern:
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.
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%.
Recommended sampling point sizes:
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.
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.
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.
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.
If the user reports misaligned Latin + CJK text on the same line, walk them through this procedure:
TMP_TextInfoDebugTool component to the TextMeshPro object displaying misaligned text.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.
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:
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+):
Recommended system fonts for CJK:
| Platform | Recommended system font |
|---|---|
| Android | NotoSans (covers Chinese, Japanese, Korean glyphs broadly). |
| iOS | PingFang 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).
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.
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.
If the user's setup matches any of these, flag it:
TextMeshProUGUI inside a worldspace Canvas - extra rebuilds for no benefit; use TextMeshPro.