Bug 194985

Summary: Mongolian text is broken because U+202F NARROW NO-BREAK SPACE does not participate in text shaping
Product: WebKit Reporter: mail
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Critical CC: corsar89, icewil, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: Mac   
OS: macOS 10.14   
Bug Depends on:    
Bug Blocks: 206208    
Attachments:
Description Flags
Safari on MacOS (Mojave)
none
On High Sierra
none
Rendered correct on Chrome, Firefox, IE, Opera etc.
none
Rendered incorrect on Safari (probably modern) none

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/
Comment 14 Myles C. Maxfield 2021-08-11 11:58:55 PDT
As far as I can tell, the Mongolian samples included here all work now. Can you verify that this is true?

*** This bug has been marked as a duplicate of bug 172205 ***
Comment 15 Myles C. Maxfield 2021-08-11 11:59:25 PDT
(I'm testing on macOS Monterey.)