Announcing Full RTL Language Support

Hello! Happy to say that UI Toolkit now has full Right-to-Left (RTL) Language support, in Unity 6.0!

RTL

This is part of a significant rewrite of our text back end to rebase ourselves on top of industry-standard open-source libraries (Harfbuzz and ICU) that the rest of the industry has been using for some time.

We’re introducing this new backend as the Advanced Text Generator (ATG), currently available as an opt-in feature in Unity 6.0, and set to become the default in future releases. ATG already achieves core parity with TextCore (our current text backend), supporting full editing, selection, navigation, font fallbacks, and key rich text tags like <link>, <a>, <b>, <i>, <u>, <s>, <color>, and more. For the latest details, check out the documentation.

If you’re curious what this means and how it works in U6, here’s a brief overview: UI Toolkit: Right-to-Left (RTL) Language Support in Unity 6.0

We hope you’ll give it a go and look forward to your feedback!

If you’re curious about why we’re introducing a new Text backend, read on.

Unity currently maintains multiple text backends: TextCore, TextMesh Pro, and the Legacy Text System. All rely on the Freetype open-source library for glyph rasterization, but each has custom implementations for standards like Unicode and OpenType.

To illustrate the scale of this challenge, the Unicode Standard (v15) spans 1060 pages, while the OpenType specification has been continuously evolving since the ‘90s and covers everything from glyph positioning to advanced typographic features. The complexity and constant evolution of these standards make it unrealistic for Unity to maintain in-house implementations.

Recognizing this, we decided to develop a Text backend based on open-source standards and libraries. ATG leverages Harfbuzz for text shaping and ICU for advanced Unicode support. This shift allows us to quickly provide better handling of complex scripts and languages, including right-to-left (RTL) languages like Arabic and Hebrew. For further insights on the current open-source text ecosystem, I recommend State of Text Rendering 2024.

21 Likes

Hello, thanks for the update. I have one question, how does this relate to the RTL mention in the roadmap video from Unite? My understanding is that “Next generation” doesn’t mean “Unity 6 generation” a.k.a. “Unity 6.x” :sweat_smile:

Hey! In U6, we’re introducing ATG as an opt-in feature. While it’s not yet at full parity with the old Text backend, our aim is to gather user feedback early to refine it further.

For the next generation of Unity, our goal is for ATG to achieve full parity and become the default Text backend for UI Toolkit and IMGUI.

1 Like

What about languages like Urdu, Sindhi, Punjabi and Indian Languages?

Hey! With Harfbuzz as our text shaper, we’re set up to handle the complex font features and character combinations for these languages.

However, since we haven’t fully tested each language, we’d really appreciate your feedback on any specific issues or gaps you encounter.

1 Like

Thank you very much for your work, it is indeed a great news after so much time, and cant wait for it to get parity with tmpro

1 Like

Does this work with TextMesh Pro / Signed Distance Fields?

1 Like

Hi! The text rendering stack is the same as TextCore, the current backend for UI Toolkit and IMGUI, which is based on TextMesh Pro. So yes, ATG uses Signed Distance Fields for text rendering.

As for ATG in TMP, the following message should clarify.

Is it in the realm of possibility to make the HarfBuzz API public and unmanaged? I would love to use it for TextMeshDOTS TextMeshDOTS...world space DOTS native text (and possibly @DreamingImLatios for Calligraphics)

4 Likes

It’s definitely in the realm of possibility. I’ll add it to our list of considerations. I’m assuming you’d like this in order to avoid dealing directly with and compiling C++ code?

3 Likes

You are assuming correct. Considering you invested already the energy to bind C++ HarfBuzz into the UnityEngine.TextCore namespace for all platforms, it would be awesome to be able to use it also from unmanaged BURST landia.

2 Likes

If you’re already integrating HarfBuzz, I think it would be awesome to open up the reusability so others can inherit your work across Unity. Dealing with C++ compilation across various platforms can be troublesome for Unity users. Not many of us are well-versed in cross-platform native compilation. It would be too wasteful of a resource if we have to do that by ourselves when Unity already has HarfBuzz integrated.

Looks awesome!
תודה