Question

I am currently using the iPhone SDK to create an app that utilizes Indic scripts. However, the iPhone has issues with rendering certain glyphs in many Indic scripts. For example:

प + ् + र = प्र

or

ਕ + ੍ + ਰ = ਕ੍ਰ

When you type this on a Mac (or Windows) the computer will automatically render the three characters into the one glyph (प्र - In Unicode it is still represented as three characters however). Because the iPhone doesn't support AAT (Apple Advanced Typography) or advanced OpenType features it renders the characters as three separate which becomes unreadable in many cases. I'm thinking there should be a way to hard code in Objective-C to ensure that every time the three characters show up in a UILabel they should render a certain glyph from the Arial Unicode MS (built-in) font instead. I do not mind using undocumented APIs to accomplish this.

Was it helpful?

Solution

The problem is not the iPhone supports only certain Indic or do not support AAT fonts. The iPhone support AAT table for sure. The problem is the proper AAT font that you use is not included!! U can have few glyph displayed because those ones are inlcude either in arialuni.ttf or helvetica.ttf. But those font do not have any OpenType or AAT tables.

I can confirm with picture what I state, I have a jailbreak iPhone and you can check flickr.com/photos/41161441@N03/ for picture for proper Khmer rendering, which is one of the most complex Indic script.

I explained the problem on modmyi.com web site forum. http://www.modmyi.com/forums/general-iphone-chat/680094-indic-font-rendering-iphone-yes-working.html#post4897261

OTHER TIPS

Start by exploring what Apple is using as follows:

  • Try entering the separate glyphs in both Notes and Mail and see if they composite. If not, then there is unlikely a hidden piece of code that does this.

  • Next, created a composited character on Mac and email it to your iPhone. See if Mail is even capable of displaying various composited characters. Repeat by hosting a webpage with composited characters and observing what MobileSafari does. I've done this one for you by viewing this page in MobileSafari; it does not composite the characters correctly. So that tells us that WebKit on iPhone can't help you (and makes it much less likely that iPhone can do this at all).

  • Finally, why do you believe that प्र is available at all on iPhone? Have you ever been able to display this glyph on an iPhone in any app? It's very possible there is no such glyph definition, in which case you may be stuck unless you're ready to write your own layout manager (which would likely require creating a completely new text view). If you've been able to display it somewhere, then you can move forward from there to figuring out how Apple is displaying it.

Is there even an Indic keyboard available on iPhone? I haven't been able to find one, and if there isn't, then it's extremely unlikely that they have very much Indic support hidden in private methods.

Be sure to open Radars (bugreport.apple.com) for any glyphs that are incorrectly drawn on iPhone. That's how they know to fix it.

I work on language learning applications.

There is little to no support for Indic scripts on the iPhone. You're going to have to write your own text rendering support and elements that use it or wait for Apple to implement it.

The iPhone OS couldn't render Arabic scripts until 3.0, and OS X only supports certain Indic text with third party rendering support.

My solution for supporting scripts iPhone OS can't render is to use pre-rendered images. Probably not much help to you, but that's what we do.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top