I'm trying to display some japanese text in my app with the help of the textwrap class but I'm facing some issues. Characters are replaced with squares.
Does anybody know how to display those characters in Gideros?
It also happened to me before; 1-Don't forget to save your txt file as unicode 2-Don't forget to look what your font is supporting. If you are using ttf font first look in some word processor for your desired language and check there. (Try to write something using that font in whatever language you want to use in Ms Word for example)
@atilim regarding complex char display, if textfield could display arabic character with proper way, i am sure we could promote our game in middle east better
Any news on Arabic or complex text layout support? I would love to use Gideros for my next project. Thanks!
You mean something like this, but from Right to Left ?
How did you do that @ozapps? I can't seem to get an Arabic font working. It displays Arabic characters on the console output, but not in the gideros player window
Note that the order they are displayed is not correct, since the above (I think is just random characters).
For example the word for Status in arabic is Al Haala and written as الحاله which in this box reads perfectly correct. However when run in Gideros, it reads the wrong way!! (I just noticed that)
You can get the characters, but they are displayed the wrong way.
Back to the drawing board to see how to fix that, alternatively pre-rendered bitmaps is another option for the interim.
I wrote a small piece of code that fixes the Left2Right issue however, the problem with these characters are that they need to be displayed sometimes together not as individual characters, but written together. For example, Für (german for) is written as that, not F¨ur. They were clever they created a system to cater for these things and now you can also write Fuer to signify the umlaut.
@chipster, do not feel bad about this, I tried with other languages and it has mixed results... mostly does not work
the same situation as yours, console workes fine, but the TTFont does not create the object properly, add the unicode language and add an AB at the end, you will see the AB but not the foreign language.
@OZapps, thanks for your concerns. I had a mistake in the initialization step of my arabic language 'ar.lua' file, so it was reverting back to English characters with the Arabic font, so they didn't render on the player. It was choking on double quotes being inside my strings. I changed them to single quotes and now it loads fine.
I'm using 'DroidArabicNaskh'. So, now I'm at the problem you posted here, and that is to get it wrap correctly in TextWrap. Two different problems (see attached image and circled in red) 1. Arabic font/text doesn't show up at all (DroidArabicNaskh) but does as Text 2. Simplified Chinese (DroidSansFallback) doesn't wrap but does show up.
The translations are not finished, so they may be incorrect.
@chipster, While I do not understand Arabic, I have seen enough arabic to say that the characters are "not-joined", i.e. they are incorrect. Arabic mostly flows (joined) this reads like Latin script, with each character separate. Works fine maybe for Chinese & Korean.
I guess part of the issue might lie with the font rendering part, @Atilim, you are the only one that can confirm this.
Comments
1-Don't forget to save your txt file as unicode
2-Don't forget to look what your font is supporting. If you are using ttf font first look in some word processor for your desired language and check there. (Try to write something using that font in whatever language you want to use in Ms Word for example)
http://www.nightspade.com
I will spend time tomorrow to check which one fits the best the issue I'm facing.
http://www.nightspade.com
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
It displays Arabic characters on the console output, but not in the gideros player window
I am using the plain and simple arial.ttf and it seems to work, I chose this as it has a couple of codepages for localization.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
For example the word for Status in arabic is Al Haala and written as الحاله which in this box reads perfectly correct. However when run in Gideros, it reads the wrong way!! (I just noticed that)
You can get the characters, but they are displayed the wrong way.
Back to the drawing board to see how to fix that, alternatively pre-rendered bitmaps is another option for the interim.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
do not feel bad about this, I tried with other languages and it has mixed results... mostly does not work
the same situation as yours, console workes fine, but the TTFont does not create the object properly, add the unicode language and add an AB at the end, you will see the AB but not the foreign language.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
I'm using 'DroidArabicNaskh'.
So, now I'm at the problem you posted here, and that is to get it wrap correctly in TextWrap.
Two different problems (see attached image and circled in red)
1. Arabic font/text doesn't show up at all (DroidArabicNaskh) but does as Text
2. Simplified Chinese (DroidSansFallback) doesn't wrap but does show up.
The translations are not finished, so they may be incorrect.
While I do not understand Arabic, I have seen enough arabic to say that the characters are "not-joined", i.e. they are incorrect. Arabic mostly flows (joined) this reads like Latin script, with each character separate. Works fine maybe for Chinese & Korean.
I guess part of the issue might lie with the font rendering part, @Atilim, you are the only one that can confirm this.
Likes: chipster123
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps