harfbuzz / harfbuzz

HarfBuzz text shaping engine
http://harfbuzz.github.io/
Other
4.16k stars 633 forks source link

Burmese နု် (U+1014 U+102F U+103A) mis-renders #365

Closed bhamiltoncx closed 7 years ago

bhamiltoncx commented 8 years ago

The Burmese grapheme နု် (U+1014 U+102F U+103A) mis-renders, even in the latest Android 7.1.

See attached image.

burmese_android_bug_1014_102f_103a

KrasnayaPloshchad commented 8 years ago

This is also mis-renders to me, even if I use Padauk and Myammar Text font on BabelPad, but when I reorder as န်ု (U+1014 U+103A U+102F), it works to me. test with myammar text test with padauk

Here is my test with hb-view Myammar Text: result Padauk: result2

Richard57 commented 7 years ago

The encoding with the vowel before the asat is simply wrong; the renderer is doing its job by highlighting an otherwise invisible spelling error. The correct coding is given in the Unicode Standard in Section 16.3 Myanmar - http://www.unicode.org/versions/Unicode9.0.0/ch16.pdf under the heading 'Contractions'. The literal transliteration of the pronoun is kywannup, which itself strongly indicates that the sequence should be <asat, sign u>.

lianghai commented 7 years ago

See the Table 16-3 in the Section 16.3 Myanmar for the syllable structure defined by the Unicode Standard, and OpenType's spec at: https://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm#well

HarfBuzz's implementation of the OT spec is in this file: https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-shape-complex-myanmar-machine.rl

Unicode's analysis and OT's spec don't allow asat immediately after vowel sign U.

bhamiltoncx commented 7 years ago

Hmm. It seems we're in a pickle, then to represent the nnu syllable.

Re-ordering to <na, asat, sign u> (U+1014 U+103A U+102F) as the Unicode standard suggests renders incorrectly on macOS 10.12.1 (and, I believe, iOS):

န်ု (U+1014 U+103A U+102F)

whereas <na, sign u, asat> (U+1014 U+102F U+103A) renders correctly on macOS and iOS, but mis-renders on Android:

နု် (U+1014 U+102F U+103A)

Screenshot on macOS 10.12.1:

screen shot 2017-01-03 at 9 44 51 am

Unless I'm misunderstanding, that means there is a bug in macOS and iOS, which also means there is no way to represent this syllable in a manner which works across Android and iOS until Apple fixes their bug.

I can report this to Apple, but is there any work around in the mean time that folks can think of?

KrasnayaPloshchad commented 7 years ago

@bhamiltoncx What happened if you try another fonts (such as Padauk)?

bhamiltoncx commented 7 years ago

@KrasnayaPloshchad: It looks like Padauk on macOS does resolve the issue. (The default Myanmar font on macOS (and, I believe, iOS), appears to be Myanmar Sangam MN, which shows the buggy behavior).

Here's what I see:

screen shot 2017-01-03 at 11 18 33 am

Unfortunately, we're still going to have trouble on iOS, since the user cannot replace the system font there without rooting the device, as far as I know.

Even if we license Padauk and ship it with all our apps and override the font inside each app, I believe we cannot override the system's font for content outside the app like push notifications, emails, etc.

bhamiltoncx commented 7 years ago

I filed a bug on Apple to track this issue (rdar://29851286) and copied it to OpenRadar:

https://openradar.appspot.com/radar?id=6093041815257088

KrasnayaPloshchad commented 7 years ago

Unfortunately, we're still going to have trouble on iOS, since the user cannot replace the system font there without rooting the device, as far as I know.

iOS does not have the term “root” in this sense, instead is jailbreaking.

lianghai commented 7 years ago

Btw, the macOS/iOS issue @bhamiltoncx noticed is an issue in Apple's AAT fonts Myanmar MN and Myanmar Sangam MN, which are unrelated to OpenType.

behdad commented 7 years ago

What's the verdict here?

bhamiltoncx commented 7 years ago

Apple bug, filed on then, but we might want to make Harfbuzz less strict here to match their behavior. On Wed, Mar 1, 2017 at 10:55 PM Behdad Esfahbod notifications@github.com wrote:

What's the verdict here?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/behdad/harfbuzz/issues/365#issuecomment-283572423, or mute the thread https://github.com/notifications/unsubscribe-auth/AApAUwsrUU2Y0vbNogbqJmkUtrLvpagMks5rhmf0gaJpZM4KxxRw .

behdad commented 7 years ago

we might want to make Harfbuzz less strict here to match their behavior.

Do you know what Windows does?

KrasnayaPloshchad commented 7 years ago

@bhamiltoncx You can try this virtual machine if you want to know what Windows does.

bhamiltoncx commented 7 years ago

I realize now that Harfbuzz is doing the right thing. Masking spelling errors like this is at best misleading, and at worst a security bug:

https://marc.durdin.net/2017/03/when-phishers-eat-rice/

Let's just close this. Thanks for your patience!