Arabic Language

I was trying to write in arabic, the editor does not support arabic so i write on the GUI using script but the problem is that arabic font is right-to-left and unity writes it for left-to-right so words looks to be flipped instead of '' it is '' so what can i do to solve this problem because it is very important to me and i can't create my product without it.

the following is the label creation script:

GUI.Label(Rect(Screen.width/2,Screen.height/2,200,40),"",ArabStyle);

the arabstyle font is unicode in which i tried multiple types of fonts and still having the same result.

what i can do to solve this problem?

Unity currently doesn't support right to left languages. The best workaround is trying to use bitmaps instead :(

Update we've released the package to the public. Click here for more info

unity don't render your text correctly even if you flip your font or reverse the string. rendering complex script languages like Arabic and Persian (Farsi) needs additional processing. in windows a library called uniscribe does this but you can not use it easily in unity. the renderer should know which character to render. for example we have different shapes of arabic letter "seen" and all of them has the same character in string. we made a solution to solve this problem. email me at ashkan_gc@yahoo.com for more information. also go and vote for right to left support here. our solution is a class that gets the string and replaces the characters with those characters that should be rendered because this part of unity is not scriptable unfortunately. vote for the above feedback and tell other users to do this because our solution is not as good as a built in solution. the standard way of rendering texts like arabic is to put logic in renderer. renderer don't modify the string like our script but instead render the correct character instead of those characters inside the string.

there is a plugin in the asset store developed by a friend that would help you guys type arabic :slight_smile:

IS there any idea on how to make my font work backword :),like how should i manipulate the font file? or can i add a custom class to do it for me? like manipulating the asset importer to flip it? i need users to write in arabic because im working on a chat application

i will do any scripting required to make it work for right-to-left but i need some guidelines :)

Try this page : Arabic/Persian/Kurdi right to left

First and best solution is using Textmesh pro. Now it has TextMeshProGUI component which is the best choice for Arabic and Persian and RTL languages for UI and you can use it in canvas. having mesh in this component name Don’t let mislead you. It can be used in canvas and UI and is even better than default Text ui text component of unity. It has no any margin problem or multi line problem.


If you want a very quick solution you can use this package as simple as

yourText.faConvert ();

for multi-line support you should set line spacing to -1.


Next solution is using the package you refer to or a better version can be found here. the only problem with this packages is some margin problems. but you should change all the text component with RTLText component so when TextMeshPro is available there is no any reason to use it anymore.


The last solution is to use this localization asset which has some auto fix for RTL languages. For multi line support you can set line spacing to -1 or it has a simple solution to break line on a constant length.