Typophile

App on iOS renders complex script marks with wrong vertical positioning

Vladimir Tamari1 votes

I am posting this under General Discussions because it concerns a very technical issue that transcends Arabic.
My favorite iOS apps (ArtStudio, Pages for iPhone and iPad) render Arabic mark positioning correctly, except for an otherwise excellent app called InkPad. InkPad for the iPad is a superb vector drawing app and renders Arabic fonts correctly except that mark positioning goes haywire for all Arabic fonts. The attached image shows how the pink marks on my AlQuds SemiBold font are displaced in Inkpad from their intended position shown in black. The adjustments differ for each letter but the app applies them in the opposite direction up or down!
I wrote to the developer a few years ago but the issue is too technical for them. Can Typophile experts help pinpoint the trouble? Thanks.

Very interesting bug. It's strange that sometimes the error is up and sometimes down. Can you derive a pattern relative to the actual GPOS anchor data, or to the default heights of the marks and how these are adjusted in the GPOS? I'm guessing, just by looking at your example, that the GPOS values might be being applied in reverse, i.e. that when you lower a mark from its default height, InkPad is raising it, and vice versa. But I'd need to see how your mark glyphs sit relative to the 0,0 position in order to determine what's going on.

In order to determine what's at fault, you need to find out what layout engine InkPad is using for OpenType Layout.

Hi John Indeed it is a simple flip of the positioning instruction reversing the direction. If you draw a line through the locus of midpoints between the pink and black marks in the diagram, you will get the original level of all the top marks at around the 620 mark . For what its worth I attach the Marks positioning data.

I can't offer any more advice without knowing how InkPad is doing OpenType Layout shaping. Is it using Apple's CoreText engine in the OS, or something else? [Note that I've heard reports of CoreText GPOS bugs in Sierra and the latest iOS, but nothing like you show here.]

Thanks I have written to the developers of the app, StoneStudio, and asked them to look into the discussions here and respond. The app is open source and the code is at https://github.com/sprang/Inkpad

The InkPad app developer wrote me the following, which confirms John Hudson's suggestion that CoreText may be responsible.
" have checked this program's source code and found that using the iOS system CoreText in this program. So, maybe this problem can't be fixed so far. But I will do my best to see if this bug could be fixed in the future.
Thanks again for you using my app and reporting this bug."

Are you able to test some other Arabic fonts in InkPad to see whether this is a common problem or something that is only affecting your font?

I did test that - it changes the mark adjustment values in the fonts that have them which I tested. Al Nile however is unchanged, probably because the marks have no positioning changes.

Captured from web.archive.org on 29 Jun 2017. view this capture