Bug 236307 - Replacing space with GSUB code produces wrong rendering
Summary: Replacing space with GSUB code produces wrong rendering
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-08 09:22 PST by akiem
Modified: 2022-02-14 19:56 PST (History)
2 users (show)

See Also:


Attachments
Test files to reproduce the described bug (12.03 KB, application/zip)
2022-02-08 09:22 PST, akiem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>