Skip to content

TextMeshPro Integration

Requirements: TextMeshPro package installed

Components:

LocalizedTMP

Auto-updates TextMeshPro text components.

Setup:

  1. Select a GameObject with TMP_Text (or TextMeshProUGUI)
  2. Click Add Component → Localized TMP
  3. Configure the LocalizedString in Inspector
  4. (Optional) Enable Use Locale Font for per-language fonts
csharp
public class LocalizedTMP : MonoBehaviour
{
    LocalizedString LocalizedString { get; set; }
    bool UseLocaleFont { get; set; }

    void SetArguments(params object[] args);
    void ClearArguments();
    void Refresh();
}

Per-Locale Fonts:

Configure fonts in your Locale settings:

  1. Select LocalizationSettings
  2. Expand a locale in Supported Locales
  3. Assign a TMP_FontAsset to the Font field

LocalizedFontComponent

Localizes TMP fonts using the Asset Table system.

csharp
public class LocalizedFontComponent : MonoBehaviour
{
    LocalizedFont LocalizedFont { get; }
    bool RestoreOriginalOnDisable { get; set; }

    void SetFontReference(string tableId, string key);
    void RestoreOriginalFont();
}

Professional Unity Development Tools