Poor rendering (bad metrics) of Noto Color Emoji font in vertical writing-modes
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox140 | --- | fixed |
People
(Reporter: zjz, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
(Whiteboard: [writing-modes:m1])
Attachments
(9 files, 1 obsolete file)
|
207 bytes,
text/html
|
Details | |
|
11.61 KB,
image/png
|
Details | |
|
9.91 KB,
image/png
|
Details | |
|
98.83 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
7.71 KB,
image/png
|
Details |
emojis get much bigger height than expected.
| Reporter | ||
Comment 1•11 months ago
|
||
The previous test file was corrupted. I've updated it with UTF-8 encoding.
| Assignee | ||
Updated•11 months ago
|
| Assignee | ||
Comment 2•11 months ago
|
||
This is probably dependent on what emoji font is used. Which platform are you using? Please attach a screenshot of how it looks for you. Thanks!
| Reporter | ||
Comment 3•11 months ago
|
||
(In reply to Jonathan Kew [:jfkthame] from comment #2)
This is probably dependent on what emoji font is used. Which platform are you using? Please attach a screenshot of how it looks for you. Thanks!
I am using deepin, which is a Linux Distro. And I've tries many local fonts by changing font-family, and the height remain wrong.
I've also confirmed that the these emojis work well in Chrome.
| Reporter | ||
Comment 4•11 months ago
|
||
| Reporter | ||
Comment 5•11 months ago
|
||
| Reporter | ||
Comment 6•11 months ago
•
|
||
(In reply to Jonathan Kew [:jfkthame] from comment #2)
This is probably dependent on what emoji font is used. Which platform are you using? Please attach a screenshot of how it looks for you. Thanks!
FYI, after some research, I've found the actually used font is NotoColorEmoji.ttf (no matter whatever font-family I actually set because of the missing character fallback mechanism).
Can someone reproduce this issue using Noto Color Emoji?
| Assignee | ||
Comment 7•11 months ago
|
||
Interesting -- trying the example in Firefox on macOS, it looks ok with Apple Color Emoji, and also works ok with Segoe UI Emoji, but using Noto Color Emoji does render quite badly (though not quite the same as the reporter's screenshot from Linux).
So both the specific emoji font and the font backend (CoreText vs FreeType) we're using seem to be factors here.
| Assignee | ||
Updated•11 months ago
|
| Assignee | ||
Comment 8•11 months ago
•
|
||
It looks like we end up with excessively large metrics for both glyph advance and line height when Noto Color Emoji is used in vertical mode.
The result in the reporter's screenshot is what happens when using the (older) bitmap version of Noto Color Emoji. Note that the result varies depending on the font size; it seems the metrics aren't being scaled appropriately. (Zoom the example to 400% and it looks roughly right!)
Replacing the Noto Color Emoji bitmap font with the newer COLRv1 version gives somewhat less awful results (similar to what's shown in my screenshot from macOS), but it's still not good.
| Assignee | ||
Updated•11 months ago
|
| Reporter | ||
Updated•11 months ago
|
Updated•11 months ago
|
| Assignee | ||
Comment 9•11 months ago
|
||
This fixes the bad positioning of Noto Color Emoji glyphs when using the
current (COLRv1) version of the font. GetGlyphVOrigin was incorrectly
returning zero because the 'glyf' data was empty; but the glyph will in
fact render, via the COLR codepath, and needs a valid origin to get
proper placement.
(The same issue could presumably affect an OpenType-SVG font that
similarly provides a 'vmtx' table but has empty 'glyf' records.)
I don't expect this to resolve the issue for the older bitmap (CBDT)
version of Noto Color Emoji; that will require a separate fix.
Updated•11 months ago
|
| Assignee | ||
Comment 10•11 months ago
|
||
| Assignee | ||
Comment 11•11 months ago
|
||
This fixes the problem of color-bitmap Noto Color Emoji getting incorrect
glyph advances in vertical mode. Without the scaling correction here, we
end up with a constant glyph advance regardless of the font size, just
based on the "natural" size of the bitmap glyphs rather than the size
we're actually scaling them to.
| Assignee | ||
Comment 12•11 months ago
|
||
Without the scaling fix, the advance of the bitmap emoji glyph isn't
scaled according to the rendered size, and so the large glyph extends
beyond the expected rect.
Comment 13•11 months ago
|
||
Comment 14•11 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a4ad6f718272
https://hg.mozilla.org/mozilla-central/rev/de68ee31172f
https://hg.mozilla.org/mozilla-central/rev/057a31f469ac
https://hg.mozilla.org/mozilla-central/rev/ea30c0eca521
Comment 15•11 months ago
|
||
Comment 16•11 months ago
|
||
Backed out for causing crashes (bug 1965123)
https://hg.mozilla.org/integration/autoland/rev/82516541b4b1d46cc4d8694428a9e5448eeb6838
Comment 17•11 months ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/66e788b91a785ecda515f8a25dc56acab6fc2d63
Comment 18•11 months ago
|
||
Comment 19•11 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/1c1f408004e1
https://hg.mozilla.org/mozilla-central/rev/eafaeb768277
https://hg.mozilla.org/mozilla-central/rev/a884b6f401c3
https://hg.mozilla.org/mozilla-central/rev/6e6b5ae23a5c
Updated•10 months ago
|
I reproduced the initial issue using an old Nightly build from 2025-04-18 on Ubuntu 22.04, verified that the testcase from comment 1 looks much better using latest Nightly 141.0a1 and Firefox beta 140.0b5 across platforms (Ubuntu 22.04, macOS 13 and Windows 11). Though on Ubuntu (most evident) compared to Chrome the testcase still looks a bit off, see the attached image where I compare how the testcase looks in Chrome vs Firefox (Chrome / Nightly / Beta).
Jonathan, do you think this is alright or there can be done something more to improve the result here?
| Assignee | ||
Comment 21•6 months ago
|
||
I think we can just call this fixed. The difference vs Chrome shown in comment 20 is largely a case of using different default fonts for the ASCII digits, so the renderings aren't really comparable.
Description
•