Bug 236307

Summary: Replacing space with GSUB code produces wrong rendering
Product: WebKit Reporter: akiem
Component: TextAssignee: Myles C. Maxfield <mmaxfield>
Status: NEW ---    
Severity: Normal CC: mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test files to reproduce the described bug none

Description akiem 2022-02-08 09:22:13 PST
Created attachment 451260 [details]
Test files to reproduce the described bug

1. replacing space with GSUB code produces wrong rendering
The reason for this is the following (explained by Myles Maxfield):
This is due to our “charactersTreatedAsSpace” logic. We measure text in differently-sized chunks different places in WebKit, and we want to maintain the invariant that, even if we split up the text and measure word-by-word, that will get the same results as if you measured the whole string including spaces. To do this, we have code in WebKit where we clobber the widths of space glyphs after shaping to set them to be equal to what they were before shaping. Fixing this would be a large architectural change; it’s something I’d like to do eventually, though.

For test files please check the attachment.
Comment 1 Radar WebKit Bug Importer 2022-02-14 19:56:42 PST
<rdar://problem/88943541>