# RTL (Persian / Arabic) Text Support for Defold 🎮

**URL:** <https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091>\
**Category:** The Defoldmine\
**Created:** [December 14, 2025, 3:50pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091 "2025-12-14T15:50:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thawri](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/thawri/32/24046_2.png) [@thawri](https://forum.defold.com/u/thawri)\
**Post date:** [December 14, 2025, 3:50pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/1 "2025-12-14T15:50:56Z")

</div>

Hi everyone 👋

I’ve released a **small open-source RTL text helper library** for **Defold** , focused on **Persian (Farsi)** and **Arabic** UI text rendering.

Defold doesn’t provide native shaping for RTL languages, so this library handles **character shaping and RTL ordering in Lua** , making it possible to correctly display Persian/Arabic text in GUI nodes.

* * *

### ✨ Features

- Correct **RTL rendering** for Persian & Arabic

- Proper **character shaping**  
_(isolated / initial / medial / final)_

- Supports **Arabic diacritics (Tashkeel / Harakat)**

- Supports **Persian semi-space**

- Supports **multi-line text**

* * *

### 📦 [GitHub Repository](https://github.com/thawri1/defold-rtl-text)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 14, 2025, 9:18pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/2 "2025-12-14T21:18:54Z")

</div>

Thank you for sharing this! I’m not sure if you are aware, but we added RTL support in Defold 1.12.0 beta:

> [@Defold 1.12.0 BETA](https://forum.defold.com/t/defold-1-12-0-beta/81981):
>
> warning Breaking changes warningFixed update + update order Note: If you don’t use fixed\_update() you don’t need to do anything. This release we did a bug fix and moved the fixed\_update() before update() in the game update loop. This means it now uses the same update flow as in Unity, and it also helps us keep our componentes (e.g. physics objects) synchronized. So please pay attention to your game logic, if it needs changing. JDK 25 For those of you using bob.jar, we have now updated t…

---

<div class="post-metadata">

**Author:** ![thawri](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/thawri/32/24046_2.png) [@thawri](https://forum.defold.com/u/thawri)\
**Post date:** [December 23, 2025, 7:10am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/3 "2025-12-23T07:10:43Z")

</div>

Today I was able to test version 1.12.1  
But it doesn’t seem to display RTL texts correctly.  
In fact, I don’t see any difference  
Do I need to take any special steps to enable RTL text?  
I also don’t see anything about RTL support in the link you sent.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [December 23, 2025, 9:22am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/4 "2025-12-23T09:22:14Z")

</div>

Hi @thawri !

Due to the added engine size the feature comes with, we decided to not include it “by default”.  
This means you will need to use an [app manifest](https://defold.com/manuals/app-manifest/) to include it.

It’s mentioned in the release notes as `"Added support for text shaping"` where RTL is one use case.  
To enable the feature, you need to:

- set the font.runtime\_generation = 1 in game.project to use .ttf fonts at runtime.
- use an app manifest, selecting the “Font Layout” feature.

We haven’t finished our example project yet, but in the meantime there is a test project here:

> **[GitHub - defold/extension-fontgen at data-only](https://github.com/defold/extension-fontgen/tree/data-only)**
>
> Adds custom font support. Contribute to defold/extension-fontgen development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![thawri](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/thawri/32/24046_2.png) [@thawri](https://forum.defold.com/u/thawri)\
**Post date:** [December 23, 2025, 9:50am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/5 "2025-12-23T09:50:18Z")

</div>

![Screenshot 2025-12-23 at 13.17.56](https://forum-defold-uploads.b-cdn.net/original/3X/3/6/3690cec32e5e5a56f7ed27e493b92eb98cb18413.jpeg)  
I try to run [extension-fontgen](https://github.com/defold/extension-fontgen) project but encounter with this errors.  
I just cloned and ran it.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [December 23, 2025, 9:59am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/6 "2025-12-23T09:59:16Z")

</div>

Note that I linked to the `data-only` branch. The main branch still uses the older version of this feature, but is deprecated and isn’t supported in 1.12.\*

Also, make sure to use the 1.12.0 Beta version for now. (I noticed that the 1.12.1 alpha is not working correctly with this example for some reason, I’m working on that)

---

<div class="post-metadata">

**Author:** ![HHH](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/hhh/32/34230_2.png) [@HHH](https://forum.defold.com/u/HHH)\
**Post date:** [February 2, 2026, 6:13pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/7 "2026-02-02T18:13:02Z")

</div>

I’m looking at adding in Arabic to our game.

I’m now using 1.12.0 and have managed to switch over to using depth field runtime fonts. Everything’s now working fine for our roman, Chinese, Japanese, Korean etc but, adding in Arabic, I’m finding that a lot of characters aren’t displaying.

Please could you confirm - should I expect Arabic to work ‘out of the box’ with 1.12.0? Or do I need to use the library that **[thawri](https://forum.defold.com/u/thawri) has provided here to deal with displaying it properly?**

Thanks!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 2, 2026, 6:44pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/8 "2026-02-02T18:44:46Z")

</div>

> [@HHH](#):
>
> Please could you confirm - should I expect Arabic to work ‘out of the box’ with 1.12.0? Or do I need to use the library that **[thawri](https://forum.defold.com/u/thawri) has provided here to deal with displaying it properly?**

It should work out of the box. @Pawel is working on an example to show all of the new functionality.

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [February 2, 2026, 7:59pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/9 "2026-02-02T19:59:56Z")

</div>

@HHH can you share with me the font you’re using? I can check.

Yes, I’m preparing a localization example and Arabic (NotoNasksArabic) works:

---

<div class="post-metadata">

**Author:** ![HHH](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/hhh/32/34230_2.png) [@HHH](https://forum.defold.com/u/HHH)\
**Post date:** [February 2, 2026, 9:28pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/10 "2026-02-02T21:28:12Z")

</div>

Thanks, that’s good to hear.

Attached is my .font and .ttf file.

Thanks!

[Archive.zip](https://forum.defold.com/uploads/short-url/o9sfHPWIFAgXoJhUDSZTBPcNstR.zip) (92.0 KB)

---

<div class="post-metadata">

**Author:** ![HHH](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/hhh/32/34230_2.png) [@HHH](https://forum.defold.com/u/HHH)\
**Post date:** [February 2, 2026, 10:16pm UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/11 "2026-02-02T22:16:21Z")

</div>

In case it sheds any light on things, this is the same piece of text in three different languages… it’s only the Arabic one that doesn’t seem to display properly. It seems like the glyphs are all being generated OK, prewarming all seems fine, just the actual display seems to mess up (for every label I have using Arabic)…

 ![Screenshot 2026-02-02 at 22.14.20](https://forum-defold-uploads.b-cdn.net/original/3X/7/7/774d4a2d8327c2c3d82b8bf9738068846379a136.png)

 ![Screenshot 2026-02-02 at 22.13.51](https://forum-defold-uploads.b-cdn.net/original/3X/2/8/28f90bcb9cbbb15439c777388aeeedb58bfbe9f1.png)

 ![Screenshot 2026-02-02 at 22.14.06](https://forum-defold-uploads.b-cdn.net/original/3X/2/5/255f02acdea05d3011c8d2f7cdf5ac658a6ca1b9.png)

This is the arabic string it’s trying to print “مجموعات الأشكال التي قمت بفتحها من شاشات الخريطة أو الفعاليات ستظهر هنا.”,

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [February 3, 2026, 6:45am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/12 "2026-02-03T06:45:03Z")

</div>

Hmm, no problems with the font itself. Maybe you can share a repro (you can send it on DM or at pawel@defold.se).

---

<div class="post-metadata">

**Author:** ![thawri](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/thawri/32/24046_2.png) [@thawri](https://forum.defold.com/u/thawri)\
**Post date:** [February 3, 2026, 6:48am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/13 "2026-02-03T06:48:30Z")

</div>

Did you test it with All Chars enabled in the .font properties?

 ![Screenshot 2026-02-03 at 10.17.42](https://forum-defold-uploads.b-cdn.net/original/3X/e/f/ef24520ac905f2e47a410064ace50dcf05e2f8e1.jpeg)

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [February 3, 2026, 6:50am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/14 "2026-02-03T06:50:37Z")

</div>

Yes, I used the `.font` file from your package, unmodified|:

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/9/6/965ab06be56804224f884deeff1ca89edefcd484.png)

(for this text, it looks like it doesn’t matter, I tested now also with it disabled)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 3, 2026, 6:59am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/15 "2026-02-03T06:59:49Z")

</div>

@HHH are you using runtime generated fonts?

> **[Enabling Runtime Fonts - Fonts in Defold manual](https://defold.com/manuals/font/#enabling-runtime-fonts)**
>
> Fonts are used to render text on Label components and GUI text nodes. Defold supports several font file formats: | This manual describes how Defold handles fonts and how to bring fonts onto the screen in your games.

---

<div class="post-metadata">

**Author:** ![thawri](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/thawri/32/24046_2.png) [@thawri](https://forum.defold.com/u/thawri)\
**Post date:** [February 3, 2026, 7:14am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/16 "2026-02-03T07:14:42Z")

</div>

@HHH  
if you don’t want to use all char you can use below chars.  
this is reduce my game size by 1.5MB. (matter for web build)  
using 3 RTL font size:  
۰۱۲۳۴۵۶۷۸۹٠١٢٣٤٥٦٧٨٩ءآأؤإئابةتثجچحخدذرزژسشصضطظعغفقکكگلمنوهيیىﭐﭑﭒﭓﭔﭕﭖﭗﭘﭙﭚﭛﭜﭝﭞﭟﭠﭡﭢﭣﭤﭥﭦﭧﭨﭩﭪﭫﭬﭭﭮﭯﭰﭱﭲﭳﭴﭵﭶﭷﭸﭹﺀﺁﺂﺃﺄﺅﺆﺇﺈﺉﺊﺋﺌﺍﺎﺏﺐﺑﺒﺕﺖﺗﺘﺙﺚﺛﺜﺝﺞﺟﺠﭺﭻﭼﭽﺡﺢﺣﺤﺥﺦﺧﺨﺩﺪﺫﺬﺭﺮﺯﺰﮊﮋﺱﺲﺳﺴﺵﺶﺷﺸﺹﺺﺻﺼﺽﺾﺿﻀﻁﻂﻃﻄﻅﻆﻇﻈﻉﻊﻋﻌﻍﻎﻏﻐﻑﻒﻓﻔﻕﻖﻗﻘﻙﻚﻛﻜﮎﮏﻝﻞﻟﻠﻡﻢﻣﻤﻥﻦﻧﻨﻩﻪﻫﻬﻭﻮﻱﻲﻳﻴﯼﯽﯾﯿﻻﻼﻵﻶﻷﻸ  
‌َ ً ُ ٌ ِ ٍ ْ ّ ٓ ٔ ٕ ٖ ٗ ٘ ٙ ٚ

ﻹﻺ؟!.،؛:«»(){}±=\*/\_%"#$'0123456789?@٪‌‍‎‏ﮐﮑﮒﮔﮕﺓﺔﻯﻰ

EDIT: its also contains persian chars. But there aren’t many. maybe numbers and ک گ چ ژ پ , and their related shapes.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [February 3, 2026, 7:41am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/17 "2026-02-03T07:41:37Z")

</div>

It’s good to know that if “runtime fonts” is used, then the “All characters” is used as the “prewarm text” instead. We’ll parse that and do full text shaping on that text, in order to generate the correct glyphs for proper shaping.  
This is good for showing a first text quickly when booting. After that, you can use the [font.prewarm\_text()](https://defold.com/ref/stable/font-lua/#font.prewarm_text:fontc-text-callback) to load new glyphs for showing.

---

<div class="post-metadata">

**Author:** ![HHH](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/hhh/32/34230_2.png) [@HHH](https://forum.defold.com/u/HHH)\
**Post date:** [February 3, 2026, 9:30am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/18 "2026-02-03T09:30:55Z")

</div>

Hi all, thank you for your answers.

I think the problem was down to my font size being too big (it was at 48). I was seeing warnings about the cache being too small and needing to be resized (even when I tried making it huge, like 16k\*16x). Shrinking the font size down to 24 has got rid of those warnings and the text now seems to display OK.

My guess is that the resize of the cache (which obviously is best to avoid so I need to shrink the font down now I’m using real-time fonts) somehow messes up the drawing of the Arabic.

Thanks everyone for your help in finding this. Great work on the RTL support!

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [February 3, 2026, 9:48am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/19 "2026-02-03T09:48:31Z")

</div>

> [@HHH](#):
>
> My guess is that the resize of the cache (which obviously is best to avoid so I need to shrink the font down now I’m using real-time fonts) somehow messes up the drawing of the Arabic.

If the glyphs gets evicted from the glyph cache, then yes, it will render incorrectly, which is why it’s good to keep track of these error message about cache size.

I’m glad you got it working now!

---

<div class="post-metadata">

**Author:** ![HHH](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/hhh/32/34230_2.png) [@HHH](https://forum.defold.com/u/HHH)\
**Post date:** [February 3, 2026, 9:52am UTC](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091/20 "2026-02-03T09:52:17Z")

</div>

One more question - I don’t have any knowledge of Arabic or RTL languages generally so please excuse me if this is a stupid question…

I noticed that the text appears different if line breaks are used. I can see that the same words seem to be there but the ordering has changed. Also, when on a single line, the ordering seems different from what I see in Google translate going English→Arabic. Trying to Google translate any of the lines on my screen back to English seems to result in a correct translation. So my question is - are all these versions of the same sentence valid? Or has something gone wrong here?

If anyone here reads Arabic ( thawri ?) and can confirm, that would be really helpful.

 ![Screenshot 2026-02-03 at 09.47.10](https://forum-defold-uploads.b-cdn.net/original/3X/d/3/d33b841935dec150e272d8e6e5c2384b0f493ec5.png)

 ![Screenshot 2026-02-03 at 09.45.39](https://forum-defold-uploads.b-cdn.net/original/3X/e/5/e5d808041926f624dd9ceef85b7efb0ac370a45e.png)

 ![Screenshot 2026-02-03 at 09.44.24](https://forum-defold-uploads.b-cdn.net/original/3X/9/3/93cecf94490bf09f75e55c4ebf7e30ea3028e43a.png)

Thanks!

[Next page](https://forum.defold.com/t/rtl-persian-arabic-text-support-for-defold/82091.md?page=2)
