I am going to need some input on how best to implement support for Right to Left. It looks like there are a few ways this could be implemented.
1. I can modify the text component to layout the text Right to Left. So as you type each character, they flow right to left and word wrapping works as expected. However, given the Unity text input box is left to right, the text in it for Right to Left languages is backwards. If you only paid attention to the text output on screen, this would behave as expected (minus) potential character substitution rules.
[ Guests cannot view attachments ]
2. Alternatively, the Arabic Support plugin could be used which re-formats the text where you can read it in the text input box however, this makes parsing the text and doing layout and warping more complex since the characters in the string are not sequential. Ie. the first character in the string is the last character of the first line and as more lines are displayed and wrapping needs to occur this gets more complex.
It seems to me that method 1 where the characters are entered right to left and flow naturally along with wrapping is the better choice. It seems like implementing some editor script that flips the text in the text input box to mirror the Right to Left while keeping the source input intact might be a better choice.
Update - Just for testing I added a Text Box showing the Source text reversed.
[ Guests cannot view attachments ]
This means that text input filtering for character substitution would also have to be implemented.
What do you guys think?
Can you provide me with a few short lines and sentences and text to work with? I would like to be able to copy paste those. Please also include some visual references.
Update 2 I guess I could use the Right to Left Text Input Box to make it possible to paste text from the Arabic Support plugin. Since this plugin expects the layout to be done Left to Right and reverses the text, I would have to re-reverse his text. Do you know if there is a way to get the text from this plugin not reversed (ie. Right to left sequence)?
[ Guests cannot view attachments ]
Bottom image is from the Arabic Support plugin, Top is in TextMesh Pro and word wrapped.
