Use UEastAsianWidth in GetUnicharWidth
Categories
(Core :: Internationalization, defect, P3)
Tracking
()
People
(Reporter: m_kato, Assigned: jfkthame)
References
Details
Attachments
(2 files, 1 obsolete file)
Reporter | ||
Updated•8 years ago
|
Reporter | ||
Updated•8 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
The GetUnicharWidth function has a bunch of hardcoded Unicode ranges for combining characters and for "wide" (East Asian) chars, but these have not been kept up to date with new versions of Unicode.
We should instead use Unicode character property APIs, and get rid of the hardcoded ranges here.
In addition, GetUnicharStringWidth looks like it was written before supplementary-plane characters were even a thing, and is oblivious to surrogate pairs. So any supplementary-plane characters will count as width=2, regardless of whether they're really "wide" or "narrow".
Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D127814
Assignee | ||
Comment 4•3 years ago
|
||
Now that GetUnicharStringWidth is aware of surrogate pairs, we also need to handle them here
so that the count doesn't get out of sync with what we originally measured.
Updated•3 years ago
|
Comment 6•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a89547fb5bb0
https://hg.mozilla.org/mozilla-central/rev/b7f3c5a2704f
Updated•3 years ago
|
Description
•