Language Arabic Support

I wasn’t able to completely follow all of the issues that have been discussed on this topic, but here’s a few common issues to consider when handling all sorts of characters.

First, many text editors allow you to set which character encoding you want to use in every file, some text editors simply push some character encoding by default. You might not see anything visually wrong in the text, but if you insert characters into the file that are not supported by the selected character encoding, then those characters may be substituted by another character or your program might crash outright.

Second, when you are using bitmap fonts, make sure that you include and use the correct kerning data. Inaccuracies in the kerning, or not using it at all, is likely to result in wonky looking text. Also, if you have different sizes of your bitmap font for Corona’s dynamic scaling, then you need to make sure that Corona uses the correct kerning file when the scaling changes. While Corona selects the correct image automatically based on the device’s resolution and your config settings, it does not automatically select the correct kerning file.

+1

Hi Kakula,

We’re having similar problems with Arabic text display.

  1. For the title part, it appears to be correct, though some letters appear to be slightly disconnected. We’re using bitmap fonts.

  2. But the message part appears to be wrong. the display should be top to bottom, but now it’s reversed.

Screenshot here. Any advice?

Ben

Hi,

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.

Hope that it’s help.

Cheers

 

 

Hi 442342472,

Thanks for replying. Been spending some time sorting out Arabic display, here is what i have discovered so far:

  1. Most text editors don’t natively support RTL languages, the visual display is wrong, but it’s logical display is correct.

  2. 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.

  3. 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.

  4. 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.

Ben

Hi Ben,

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.

Dominic

 

 

Hi Dominic,

We’ll keep that in mind. Please share any invaluable advice implementing RTL languages.

Thanks.

Ben.

Hi Ben,

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.

Dominic
 

 

What kind of issues?

Ben

Hi Ben,

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.

Dominic

 

 

+1

I wasn’t able to completely follow all of the issues that have been discussed on this topic, but here’s a few common issues to consider when handling all sorts of characters.

First, many text editors allow you to set which character encoding you want to use in every file, some text editors simply push some character encoding by default. You might not see anything visually wrong in the text, but if you insert characters into the file that are not supported by the selected character encoding, then those characters may be substituted by another character or your program might crash outright.

Second, when you are using bitmap fonts, make sure that you include and use the correct kerning data. Inaccuracies in the kerning, or not using it at all, is likely to result in wonky looking text. Also, if you have different sizes of your bitmap font for Corona’s dynamic scaling, then you need to make sure that Corona uses the correct kerning file when the scaling changes. While Corona selects the correct image automatically based on the device’s resolution and your config settings, it does not automatically select the correct kerning file.

+1