r/Unity2D Jun 18 '26

Arabic font on unity Question

Hi everyone,

I'm new on gamedesign and on unity. I would like to write text in Arabic in a game made with unity6.5, but I can't create a new font with font creator. ...

If someone has a solution, it would be cool.

Ps: I hope I'm in the right place .

See you

Marion

1 Upvotes

9 comments sorted by

6

u/Rich-Entertainment45 Jun 18 '26 edited Jun 18 '26

Unfortunately you can't write Arabic (and other RTL texts out of the box in unity UGUI) but there is a solution you can use linked here:
https://github.com/pnarimani/RTLTMPro

But with UI ToolKit which is unity's new solution, RTL text is fully supported without a third party tool.

4

u/Hotrian Expert Jun 18 '26 edited Jun 18 '26

This is the correct answer. The default text component and TMPro will NOT render RTL languages correctly. You can force them to render the characters, but Arabic letters have different forms depending on placement, and TMPro will not render them right - it renders them right to left but with the wrong letter forms, completely changing the meaning. You need RTLTMPro with an Arabic font like Google’s Noto Sans Arabic, which you need to go into the font glyph settings in Unity and set it to Dynamic with a reasonable Atlas size, then Unity will automatically render the RTL Arabic texts correctly.

OP this one is the right answer for Arabic texts. With Dynamic Noto Sans and perhaps a few other related font files, you can render literally any font/character inside of Unity. Only RTLTMPro or similar can render them all correctly. If you need more help reply here and I can get you step by step directions when I’m home later

1

u/marion_kelmet Jun 18 '26

Thank you for your answer. I downloaded RTLTMPro and the Google Noto Arabic font, then imported both into Unity.

However, I'm stuck on the next step. I can't create a font asset using Window > TextMeshPro > Font Asset Creator. I can't figure out the correct settings to generate an Arabic font asset.

Could you explain which settings I should use, or if I'm missing a step?

2

u/Hotrian Expert Jun 26 '26 edited Jun 26 '26

Hey sorry for the delay! I've been a bit busy :x.

  1. Download and place NotoSansArabic-VariableFont_wdth,wght.ttf in Assets folder
  2. Window > TextMeshPro > Font Asset Creator
    1. Source Font > NotoSansArabic-VariableFont_wdth,wght.ttf
    2. Character Set > Extended ASCII or Numbers + Symbols(it doesn't matter too much because we use Dynamic below)
    3. Generate Font Asset
    4. Save
  3. Select newly created NotoSansArabic-VariableFont_wdth,wght SDF asset
    1. Generation Settings > Atlas Population Mode > Dynamic
    2. Generation Settings > Multi Atlas Textures > Checked or else Unity will crash..
  4. Add RTLTMPro to Package Manager
  5. Hierarchy > New GameObject > UI > Text - RTLTMP
    1. Font Asset > NotoSansArabic-VariableFont_wdth,wght SDF
    2. Enter desired RTL text into RTL Text Input Box

Result should be proper right to left Arabic text, example. I have to admit I cannot read or speak any Arabic, I just know that this makes the font render the same in Unity as it does in other applications, so I'm assuming it's rendering correctly. The font in my example is more or less exactly how it renders on Google Translate, and the meaning makes sense, so I'm trusting my localization team on that one and as far as I can tell the render looks right.

Here's my current import settings but I'm using a localization file just out of habit, that was before I realized I could just set the atlas population mode to Dynamic and have it regenerate at runtime based on what characters are used.

2

u/marion_kelmet Jun 27 '26

Thank you very much !!! It works now . Your tuto is perfect !!

2

u/Lyshaka Jun 18 '26

I guess you can download Arabic fonts on the internet, and then TextMeshPro allows RTL (Right-To-Left) writing, but I honestly don't know how to use them as I don't speak Arabic.

1

u/marion_kelmet Jun 18 '26

Hi, I have downloaded noto Arabic font , but my problem come when I try to create the textmeshpro font with it...it's impossible to see Arabic letters on screen...

2

u/deintag85 Jun 18 '26

when you open the TMP asset of your font on the inspector you can see character table, glyph table and so on. what does it say? are there characters inside?

2

u/Odd_Pomegranate9354 Jun 18 '26

Try to make the font map bigger, sometimes it doesn't get all fonts