The problem is showing in the picture. Left side is a arabic sentence showing in the Excel and the right side is showing in the Corona SDK. The problem is the last punctuation is always converted to right side of the sentence. It supposed to be left side of the sentence. And the other thing is if i put some arabic letters after the last punctuation, it is all good.
Hi Rob, Thanks for your reply, I don’t know why i cannot attach my jpg file. Anyway, i found that if i add a period in the end of arabic sentence string. The period supposed to be the left of the sentence because the writting direction of arabic is from right to the left. But the period was showing in the right of the sentence when rendering to the corona. Dominic
I think the problem is the writting direction of arabic is opposite with our language. When we writting the arabic string in the sublime, we will write it from left to right, but we need to reverse arabic string before we render to the corona sdk. The render engine may make some change in this part.
The render engine just takes the string and generates a display object. We in no way analyze the string and move characters around and since we use the operating system’s text rendering, they might, but I don’t see why they would.
If you render: “.sentence a is this” that’s what you should get back.
Hi Rob, Thanks for your reply, I don’t know why i cannot attach my jpg file. Anyway, i found that if i add a period in the end of arabic sentence string. The period supposed to be the left of the sentence because the writting direction of arabic is from right to the left. But the period was showing in the right of the sentence when rendering to the corona. Dominic
I think the problem is the writting direction of arabic is opposite with our language. When we writting the arabic string in the sublime, we will write it from left to right, but we need to reverse arabic string before we render to the corona sdk. The render engine may make some change in this part.
The render engine just takes the string and generates a display object. We in no way analyze the string and move characters around and since we use the operating system’s text rendering, they might, but I don’t see why they would.
If you render: “.sentence a is this” that’s what you should get back.
You don’t need to be confused when you see the arabic text in corona sumulater. The Corona render might be wrong, but when you pack your app and install in your phone, you will find everything is rendering in right way.
Thanks for replying. Been spending some time sorting out Arabic display, here is what i have discovered so far:
Most text editors don’t natively support RTL languages, the visual display is wrong, but it’s logical display is correct.
I was using Sublime Text with a bidi plugin. It fixes the visual display but it also screws up with the logical display, resulting in text to speech failing to read them. You can verify this easily by pasting any fixed Arabic sentence to Google Translate, you’ll get nonsense.
Was using fontmanager.lua to display bitmap fonts in Arabic. display.newBitmapText ( ) does not seem to be able to render Arabic correctly. You can use bidi algorithm to fix the display, but that will screw up your text to speech.
Even though the visual display in wrong in text editors, Corona renders them properly in the latest versions I’ve been using. Corona’s display.newText ( ) renders Arabic correctly and supports multi-line displays and right alignment with systemfont, even in the simulator.
Thanks for replying. The version of our Corona is 3184. We found that the arabic rendering was wrong in simulator but was right in phone.
We will download the latest release of corona and try again. I think you don’t need to mind the visual display in text editor, as long as the redering was right on the phone.
We just find a new thing. When you pack your game and test on the phone, remember testing it on both IPhone and android, because we found the rendering are different and we need to fixed some problem for IOS.
We need to set align in function display.newtext for ios but no need to set that for android. And the visual display of textField also have same problem.