Unity Tools

    Arabic and RTL Text in TextMeshPro: Why It Breaks and How to Fix It

    TextMeshPro does not shape Arabic letters or run the bidirectional algorithm, so RTL text shows up as disconnected letters in the wrong order. Here is what is actually missing, the three fixes people use, and where each one breaks.

    Ronald Farkas6 min read

    Localise a Unity game into Arabic and the first screenshot from your translator will be a complaint: the letters are there, but they are isolated instead of joined, and the words run left to right. Hebrew and Persian show the same problem. Nothing is wrong with the font. TextMeshPro simply does not implement two things the script needs.

    The two missing pieces

    • Shaping. Arabic letters have up to four forms depending on their neighbours (isolated, initial, medial, final), plus ligatures such as lam-alef. A renderer has to pick the form per letter. TMP draws the isolated form every time.
    • Bidirectional layout. Unicode’s UAX #9 algorithm decides the visual order of mixed runs: an Arabic sentence containing an English brand name and a number has three directions in it. TMP lays glyphs out left to right in logical order.

    Fix 1: pre-convert the strings

    The classic approach runs each string through a converter that substitutes the presentation forms and reverses the order, then hands TMP a string it can draw naively. It works for static labels. It breaks the moment you need anything dynamic: typewriter effects, per-character animation, rich-text tags, or a text field the player types into, because the converted string is no longer the real text.

    Fix 2: a native shaping library

    HarfBuzz or a platform text engine does it properly. The catch is deployment: native plugins mean per-platform binaries, and WebGL builds usually cannot take them at all. Fine for a console title, painful for a hypercasual game that ships to five platforms.

    Fix 3: hook TMP’s text preprocessing

    TextMeshPro exposes an official text-preprocessor path. A component on the label can shape and reorder the text there, in managed C#, before TMP generates its mesh. The original string stays intact, so animation, rich text and input keep working, and there is no native code, so WebGL and every other platform build normally. This is the approach TypeFlow Pro takes: it joins contextual forms, runs the UAX #9 algorithm for mixed RTL, Latin and numeric runs, mirrors punctuation and flips alignment to the paragraph direction, on the TMP labels you already have.

    What to test, whichever fix you use

    1. A sentence with a brand name in Latin letters in the middle.
    2. A number with a percent sign, and a date.
    3. Lam-alef and at least one word with a tashkeel mark.
    4. Right alignment and word wrapping over three lines.
    5. A typewriter or fade-in animation on the same label.
    6. A WebGL build, if you ship one.

    Arabic-speaking markets are among the highest-value regions for casual games and among the least served. A correct RTL implementation is not polish; it is the difference between a launch there and a one-star wall.

    More guides