Thank you for such a clear and concise report, excellent! We currently don’t support this out of the box. There’s no RTL checkbox or anything like that on labels and text nodes.
By disjointed do you mean the spacing between the individual glyphs or something else?
For a serious project supporting multiple languages you likely want a system on top of Defold that takes care of setting the label or text node texts. This system could reverse the text before setting it on a label or text node to properly deal with RTL vs LTR languages. The same system could also set the right or left align property on the node. For gui text nodes you could perhaps even put the translation key in the text node and get it before translation.
Reversing the characters is a good start. In my quest to find a 2D game engine that supports Arabic text natively, I came across a lot of details (some of which weren’t mentioned here, sorry).
There are several pieces that need to be in place for this to work properly:
Unicode support for non-ASCII characters (so you don’t see boxes)
Right-to-Left support (Chinese/Japanesse/Korean, Arabic, Urdu, etc.)
Glyph shaping. In languages like Arabic, Thai, and others I can’t remember, the letter appears differently depending on if it’s the first, last, or middle letter in the word.
All of the game engines that I’ve found seem to use HarfBuzz to implement this. It’s not a small library, but it handles all of the different languages well. I think it’s some sort of C++ library.
@Pkeod how did you generate your second image (this one)?:
Why does the font seem to be trimmed? I’ve tried different fonts, letter spacing and line spacing, but the result is the same.
Left-Defold, right - google font site
In Arabic, letters change their shapes depending on whether they’re at the beginning, middle, or end of the word. The letter taa (two dots smiley face) at the end of the word should look like a smiley-face (Google screenshot). Defold is showing the version of taa that’s in the middle of two other letters.
Please take a look at my previous post here. Arabic (and languages like Thai) require several features: left-to-right, diacratic marks, and glyph shaping.
My understanding from other game engines and frameworks that support this (Godot 4.0+, Lime/OpenFL) do so by integrating the HarfBuzz library, or something similar. I don’t have any personal experience in this area.