Unicode Characters Flipping in Keynote?

I realize that this is a long shot posting here, and this isn't a Rust issue per se...but people are really smart here and I'm doing this for Rust, so just in case...

I am creating an "Intro to Rust" presentation for OpenWest, and I'm trying to use the "namaste" example from the second edition of the book, but Apple Keynote flips the unicode characters backwords and shifts them when the view is over a certain size (including the full-screen presentation size).

Any ideas?

Things I have tried:

  • Recreating the string.
  • Different fonts
  • Restarting Keynote
  • Posting on Twitter, Apple Forums, and here.

/facepalm

I also tried to report it as a bug to Apple, but Apple's bug reporter is broken.

I'm hedging my bets. I'm creating equivalent slides with "açaï", which doesn't exhibit the problem behavior. Not quite as exotic, but it gets the point across.

It's hard to know for sure without access to Apple's source code, but my first guess is that Keynote is using a text shaping library that has a bug in its positioning code for Indic scripts. Perhaps it is using a small integer type like i16 for glyph advances, and very large font sizes cause an overflow.

There may be nothing you can do to make Keynote render this text correctly itself; as a workaround, maybe you could embed a screenshot in place of the text.

3 Likes

Off topic, but would appreciate a copy of the file. I agree with @mbrubeck's analysis.

1 Like

Hmm. This forum does not allow non-image attachments. How inconvenient.

Here is a dropbox link to a presentation with just the affected slides. I will delete it in a few days.

Edit: Note that I am on a 5k screen (5120 x 2880) and the application window is about half the width of the screen when the problem occurs for me.

So it seems to happen only in Bengali and Devanagari on my machine.

Gurmukhi, Gujrati, Tamil, Malyalam, Tibetan, and Thai do not have this despite being Brahmi-derived abugidas which presumably use similar font features (as they work similarly). Neither do Mongolian and Arabic, which should also have significant overlap in font feature usage.

Definitely looks like a shaping bug in whatever Apple is using. I don't know enough about the internals of fonts to tell you what font feature is buggy here.

1 Like

Wow! Thanks for investigating that so much.

Edit: Actually, double that thanks! It turns out that açaï doesn't have the same characteristics that नमस्ते did (different numbers of bytes vs scalars vs graphemes), so based on your report of which languages did NOT have the bug, I selected the Thai word สวัสดี which appears to be non-gender portion of the greeting which is used as hello/goodbye.