Bug 194985 - Mongolian text is broken because U+202F NARROW NO-BREAK SPACE does not participate in text shaping
Summary: Mongolian text is broken because U+202F NARROW NO-BREAK SPACE does not partic...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.14
: P2 Critical
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 206208
  Show dependency treegraph
 
Reported: 2019-02-23 18:44 PST by mail
Modified: 2020-08-17 02:32 PDT (History)
4 users (show)

See Also:


Attachments
Safari on MacOS (Mojave) (507.32 KB, image/png)
2019-02-23 18:44 PST, mail
no flags Details
On High Sierra (223.68 KB, image/png)
2019-02-24 08:17 PST, mail
no flags Details
Rendered correct on Chrome, Firefox, IE, Opera etc. (730.27 KB, image/png)
2019-03-03 13:24 PST, mail
no flags Details
Rendered incorrect on Safari (probably modern) (762.12 KB, image/png)
2019-03-03 13:26 PST, mail
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mail 2019-02-23 18:44:16 PST
Created attachment 362844 [details]
Safari on MacOS (Mojave)

Hi,
NNBSP is not correctly rendered on MacOSes.
NNBSP (202F) is a very problematic character in Unicode standard and used to connect Mongolian suffixes to stems or to preceding suffix. 
If this character handled as white space, then almost all Mongolian suffixes can not be rendered correctly.
However, recently almost all engines and word processors render this character correctly. Even Webkit itself on iOS renders it flawless.
It is just broken on MacOS.
Please correct it.
Comment 1 mail 2019-02-24 08:17:47 PST
Created attachment 362857 [details]
On High Sierra

On High Sierra .notdef glyph is shown instead of NNBSP.
Comment 2 mail 2019-02-24 08:36:00 PST
The shaping is also failed on High Sierra. The attachment is just to show .notdef glyph.
Comment 3 Myles C. Maxfield 2019-02-28 19:18:38 PST
What is a link where I can view that webpage in the screenshot? I would like to investigate this.
Comment 4 Radar WebKit Bug Importer 2019-02-28 19:20:34 PST
<rdar://problem/48498356>
Comment 5 mail 2019-03-01 11:22:19 PST
Dear  Myles C. Maxfield,
The webpage is reachable under http://test.openmn.org/.

Thanks!
Comment 6 Myles C. Maxfield 2019-03-01 15:06:11 PST
I just opened that webpage on macOS and iOS, and the two sites look identical to me. Can you describe more specifically which part of the rendering is incorrect?

(I can't read Mongolian, so I'd appreciate as much detail as possible.)
Comment 7 mail 2019-03-03 13:24:42 PST
Created attachment 363468 [details]
Rendered correct on Chrome, Firefox, IE, Opera etc.
Comment 8 mail 2019-03-03 13:26:57 PST
Created attachment 363469 [details]
Rendered incorrect on Safari (probably modern)
Comment 9 mail 2019-03-03 13:27:12 PST
Ahh sorry,
NNBSP is also broken on all modern iOS. I just tested on iOS 12.1.1, iOS 12.1.4.
There exist no problems on old iOS devices. For instance: iOS 9.3.5
I just uploaded to images one is incorrect (Safari-Incorrect.png) and one is correct (Chrome-Firefox-IE-correct.png).
Comment 10 Myles C. Maxfield 2019-03-04 13:33:05 PST
(In reply to mail from comment #9)
> Ahh sorry,
> NNBSP is also broken on all modern iOS. I just tested on iOS 12.1.1, iOS
> 12.1.4.
> There exist no problems on old iOS devices. For instance: iOS 9.3.5
> I just uploaded to images one is incorrect (Safari-Incorrect.png) and one is
> correct (Chrome-Firefox-IE-correct.png).

Ah, that makes it much more clear. Thank you so much!
Comment 11 Myles C. Maxfield 2019-03-04 13:53:26 PST
Using raw CoreText draws it correctly. My guess is that the shaping tables in the font specifically involve the NNBSP character, but WebKit treats this character as a space and chops up the text here, and doesn't include the NNBSP in the shaping.
Comment 12 mail 2019-03-04 14:19:56 PST
Yes,
NNBSP is introduced in Unicode to shape Mongolian separated suffixes correctly and to do correct word boundary.
Thus, NNBSP is used in OTF table to shape that suffixes. This character should not be handled as SPACE.
Comment 13 shrpne 2019-06-07 04:26:14 PDT
Similar issues:
https://bugs.webkit.org/show_bug.cgi?id=172205
https://bugs.webkit.org/show_bug.cgi?id=180744

Also want to note, that this problem occurs for all fonts I have tried, including system-ui, serif and sans-serif generic fonts.

And here is another test case reproducing no width for 202F:
https://jsfiddle.net/3g7yc5nf/1/