Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
Thai does not display properly on iOS
Tested so far just on iOS 15, some Thai characters are replaced by strange circles when using native device font. They display correctly on Android.
Here is the iOS version:
and same screen on Android which renders correctly:
The project is using starling textfields with font set to _sans to force native device font.
Embedding a font isn't a great workaround for me because my app needs to support 10+ languages and sometimes the text fields will share more than 1 language at a time. Other times it can be hard to detect which language the textfield contains to change the font used.
I suppose, embedding the fonts is not a workaround, but a recommended practice (please, correct me if I'm wrong)
But in your case it looks like that the diacritic symbols are not placed properly above the appropriate symbols - I'll stay subscribed to the topic as I want to add Thai localizations to my games some day and want to see the discussion
Correct me if I'm wrong anyone, but I believe AIR has some serious underlying text rendering issues on iOS, which is why some Chinese characters render incorrectly, why Chinese device font's cant show bold characters, why emojis cant be displayed, and for example this Thai issue. I think the reason they haven't been addressed them yet is because it's quite hard, a big rewrite is needed and will take a lot of work for the Harman guys. (Who I think are doing a great job addressing a ton of issues btw so no shade to them)
But I really hope this can be done, modern-day apps need multi-language support and emoji support
GeneralVimes is right. If you look at any string – the bottom one over an orange background is clearest – then all the letters are there on iOS, but the diacritics (vowels) aren't being drawn properly over the consonants, instead it is drawing them as isolated symbols, with the circles indicating how to position them above or below a consonant. See e.g. this table which uses similar symbols.
So it's rendering the glyphs but not applying the rules for combining them. iOS has had good, stable support for Asian languages since launch. AIR should not need to do much to take advantage of this.
Hi
AIR (and Flash Player) has a lot of issues with text rendering in general... which is one of the reasons Adobe introduced the 'StageText' concept, to take advantage of the operating system's capabilities. Then there's the normal/classic TextField, which is only for very basic functionality, or the TLFTextField (or TextBlock/TextLine APIs) if you need advances things.
Normally I'd suggest using TextLine if you're dealing with Thai or similar. You've mentioned this is using the Starling TextField class which I believe renders characters into a texture using a TextField and BitmapData.draw.. so in the short term, are you able to switch to rendering these via a TextLine?
The text rendering code is a big challenge with a lot of code following different approaches that have been tried over the years, so we can take a look, but it's unlikely to be a quick fix..
thanks