Arabic Text in Unity: Fix Disconnected and Reversed Letters

Last reviewed

Short answer

Arabic letters change shape depending on their neighbors and the line is read right to left, so a text renderer needs a shaping engine and the Unicode Bidirectional Algorithm. TextMesh Pro has neither: it draws each character in its isolated form, in the order the characters are stored, so words come out disconnected and reversed.

UniText shapes Arabic, Persian and Urdu with HarfBuzz and runs the full Bidirectional Algorithm on every paragraph, so connected letters, mixed Arabic and English, digits and punctuation render correctly with no plugin and no direction flag.

Why Arabic breaks in TextMesh Pro

Two separate things have to happen before Arabic text looks right, and TextMesh Pro does neither of them.

  • Shaping. Most Arabic letters have up to four forms: isolated, initial, medial and final. Which form appears depends on the letters around it, and pairs such as lam and alef merge into one ligature. The font stores these rules in its OpenType tables, and a shaping engine such as HarfBuzz applies them. Without one, every letter is drawn in its isolated form.
  • Bidirectional ordering. Text is stored in logical order, the order it is typed. Arabic runs must be displayed right to left while numbers and embedded English stay left to right, and punctuation between them takes its direction from its context. The Unicode Bidirectional Algorithm (UAX #9) resolves that order per line.

TextMesh Pro, which ships inside com.unity.ugui in Unity 6, applies only four OpenType features: kerning, ligatures and two kinds of mark positioning. It has no shaping engine and none of the contextual substitutions that select Arabic letter forms. Its right-to-left option, in Unity's words, reverses the text before it is displayed. It does not reshape letters, resolve mixed directions or mirror brackets, so it cannot fix either problem on its own.

Unity's text team said in October 2024 that adding Arabic support to TextMesh Pro was too risky that late in the Unity 6 cycle and would be re-evaluated later. The TextMesh Pro that ships with Unity 6.6 still contains no shaping engine.

The usual workarounds and their limits

Plugins for TextMesh Pro rewrite the string before TextMesh Pro sees it. The most widely used, RTLTMPro (MIT, maintained, with a Unity 6 release in April 2026), replaces each letter with a precomposed character from the Arabic Presentation Forms block, reorders the line with its own rules and then turns on TextMesh Pro's right-to-left mode. This makes most lines readable, with known costs:

  • The font atlas must contain the presentation-form characters, which many modern Arabic fonts do not include because they rely on OpenType shaping.
  • Lines that mix Arabic with English, numbers or rich-text tags are reordered by simple rules rather than the full algorithm, so punctuation and word order around them drift.
  • Diacritics (tashkeel) and fonts with contextual alternates, such as Nastaliq for Urdu, need more than one-to-one substitution.
  • The string in memory is the rewritten one, which complicates input fields, copying and reading the text back.

In UI Toolkit, Unity's Advanced Text Generator uses HarfBuzz and ICU to shape and order right-to-left text. It is opt-in in Unity 6.0 to 6.4, and Unity announced it as the default in 6.5. It applies to UI Toolkit, not to uGUI canvases or TextMesh Pro components.

How UniText renders Arabic

Greetings across many writing systems with emoji, among them Arabic, Hebrew, Devanagari, Tamil, Thai and CJK, rendered by UniText.
  • HarfBuzz applies the font's own OpenType rules, so letters join, ligatures form and marks sit where the font designer placed them.
  • The full Bidirectional Algorithm runs on every paragraph, including nested embeddings, mirrored brackets and neutral characters between runs.
  • The base direction is automatic: each paragraph takes it from its first strong character, so an Arabic paragraph and an English paragraph can share one component.
  • Caret movement, selection and hit-testing follow the visual order, and letter spacing inserts tatweel instead of breaking joins.
  • On desktop and mobile, system-font fallback renders Arabic even when the project ships only a Latin font.
  1. Add a UniText component: GameObject › LightSide › UniText › UniText.
  2. Assign your text in the Inspector or from code. No direction setting is needed.
  3. For WebGL, assign a font that covers Arabic, since browsers give WebGL no access to system fonts.
csharp
using LightSide;
using UnityEngine;

public class ScoreLabel : MonoBehaviour
{
    [SerializeField] UniText label;

    public void Show(int score)
    {
        label.Text = $"النتيجة: {score} نقطة (Level 3)";
    }
}

The same applies to Persian, Urdu, Kurdish and other languages written in Arabic script, and to Hebrew, Syriac and Thaana.

Questions

Do I need a font with Arabic presentation forms?

No. UniText shapes from the font's OpenType tables, so any font that supports Arabic works, including modern fonts that contain no presentation-form characters.

Does it handle Arabic mixed with English and numbers?

Yes. Each paragraph goes through the Unicode Bidirectional Algorithm, so English words, digits and punctuation keep their correct positions inside Arabic sentences.

Can players type Arabic?

Yes. Editable text and input fields use the same shaping and ordering while typing, and IME input is delivered by the operating system.

Check it in your project

Run the browser demo, follow the setup guide, or compare the free version with the licenses.

Related problems