Hebrew and Right-to-Left Text in Unity: Reversed Numbers and English Words

Last reviewed

Short answer

Hebrew letters do not join, so Hebrew looks easy, but every real sentence mixes directions: numbers, English names, punctuation and brackets inside right-to-left text. TextMesh Pro's right-to-left option draws the whole text in one direction and does not run the Unicode Bidirectional Algorithm, so pure Hebrew reads correctly but numbers and English words come out reversed, 2026 as 6202, and brackets face the wrong way.

UniText runs the full Bidirectional Algorithm on every paragraph, so Hebrew, Arabic, Persian, Urdu, Syriac and Thaana mixed with Latin text, numbers and punctuation display in the correct order, with mirrored brackets and a caret that follows the text.

What mixed-direction text needs

Text is stored in the order it is typed. The Unicode Bidirectional Algorithm (UAX #9) splits each paragraph into runs, decides which way each run reads and in what order the runs appear on the line, and does it again for every line after wrapping:

ContentWhat has to happen
Numbers in Hebrew text“2026” and “+972-50-123” keep their left-to-right order inside the right-to-left line
English wordseach Latin run reads left to right, while the runs are placed right to left
Punctuation between runstakes its direction from its neighbors, so a period ends the Hebrew sentence on the left
Brackets( and ) are mirrored in right-to-left context so they still enclose their contents
Wrapped linesreordering happens per line after wrapping, so the first line holds the start of the sentence

The usual options

  • TextMesh Pro's right-to-left mode. It subtracts each advance instead of adding it, so the stored string is laid out from the right edge. Pure Hebrew lines read correctly; Latin letters and digits inside them are laid out the same way, which users report as flipped numbers and English words, and brackets are not mirrored. The TMP input field has no right-to-left handling, so arrow keys move by stored order and the first selected character can look unselected.
  • RTLTMPro. It reverses the string with its own rules, keeps Latin runs and numbers in order and mirrors brackets next to right-to-left letters. It does not implement the Unicode Bidirectional Algorithm, and its open Hebrew issues include mixed Hebrew, English and numbers in the wrong order, rich-text tags reversed and misplaced diacritics.
  • UI Toolkit. With the Advanced Text Generator it runs full bidirectional layout; without it, right-to-left support is basic text reversal. The caret moves in logical order only.

Right-to-left text in UniText

  • 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 Hebrew and English paragraphs can share one component, or a direction can be forced.
  • Lines wrap first and reorder afterwards, so multi-line paragraphs read in the right order.
  • Hebrew points (niqqud) and cantillation marks are positioned by HarfBuzz from the font's tables.
  • Caret movement, selection and hit-testing are bidirectional-aware, with caret affinity at direction boundaries.
  • Rich-text tags and Markdown work across direction changes, because styles apply to logical ranges.
text
ההזמנה מספר 4521 נשלחה ב-12.03.2026 (Express) — תודה!

The line above is stored exactly as typed: the order number, the date and the English word keep their own direction, and the brackets and dash land where a Hebrew reader expects them.

Questions

Do I need a special Hebrew font?

No. Any font with Hebrew glyphs works, and on desktop and mobile the operating system's Hebrew font is used automatically when your font has none.

Does it work in input fields?

Yes. Editable text and input fields reorder live while typing, and the caret moves through mixed-direction text the way readers expect.

Check it in your project

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

Related problems