Closed
Bug 1267909
Opened 8 years ago
Closed 7 years ago
"Noto Color Emoji" font takes up a minimum of 64px of height, even at small sizes
Categories
(Core :: Graphics: Text, defect)
Tracking
()
VERIFIED
FIXED
mozilla55
People
(Reporter: dbaron, Assigned: lsalzman)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(8 files)
416 bytes,
text/plain
|
Details | |
148 bytes,
text/html
|
Details | |
3.10 KB,
image/png
|
Details | |
26.94 KB,
image/png
|
Details | |
17.67 KB,
text/plain
|
Details | |
5.01 KB,
patch
|
jfkthame
:
review+
gchang
:
approval-mozilla-beta+
jcristau
:
approval-mozilla-esr52-
|
Details | Diff | Splinter Review |
186.20 KB,
image/png
|
Details | |
528.96 KB,
image/png
|
Details |
A while ago I symlinked the Noto Color Emoji font from https://github.com/mozilla-b2g/moztt into my ~/.fonts/ directory and created a .config/fontconfig/conf.d/65-emoji.conf (which I'll attach) to make this font be used. This didn't work at the time because fontconfig wouldn't match the font, I believe because it was a bitmap font. Upgrading from Ubuntu 15.10 (wily) to Ubuntu 16.04 LTS (xenial) made this start working. However, it has the strange result that characters rendered in the Noto Color Emoji font add a *ridiculous* amount of extra line-height, presumably because we're getting strange metrics for the font somehow.
Reporter | ||
Comment 1•8 years ago
|
||
Reporter | ||
Comment 2•8 years ago
|
||
Reporter | ||
Comment 3•8 years ago
|
||
Reporter | ||
Comment 4•8 years ago
|
||
This shows why this bug is rather annoying to me. :-) Comments are affected similarly, although it's not quite as bad there.
Reporter | ||
Comment 5•8 years ago
|
||
It seems like this is related to the font being a bitmap font containing multiple sizes. If I break in gfxFont::SanitizeMetrics, the entire metrics struct looks like metrics appropriate for a much larger font (emHeight = 55, maxHeight = 64) when mStyle.size is 12 (and mStyle.sizeAdjust is -1).
Reporter | ||
Comment 6•8 years ago
|
||
Actually, maybe it's just that it's a bitmap font, since the available multiple sizes are heights of 64 and 128.
Reporter | ||
Comment 7•8 years ago
|
||
Reporter | ||
Comment 8•8 years ago
|
||
Also note that if I increase the font size (using devtools), the "extra" space reduces (i.e., the size required stays the same), and the problem goes away around a size of 50px or 55px.
Reporter | ||
Updated•8 years ago
|
Summary: "Noto Color Emoji" font has bizarre metrics → "Noto Color Emoji" font takes up a minimum of 64px of height, even at small sizes
Comment 9•8 years ago
|
||
What's happening is that the font has 64px bitmaps. The fact that they need to be scaled is reflected in FC_MATRIX element of the font pattern. Cairo handles that correctly. I don't know where Firefox is getting its metrics from, that misses this in layout.
Updated•8 years ago
|
Whiteboard: [gfx-noted]
Comment 10•7 years ago
|
||
I can confirm experiencing this issue. (Linux Mint 18.1) This makes it so Firefox users can't properly use the latest Noto Color Emoji font from https://github.com/googlei18n/noto-emoji/ unless they can deal with the rather tall line-spacing. The font works normally in chromium.
Assignee | ||
Comment 11•7 years ago
|
||
In the FreeType metrics, ascender/descender/max_advance/height all depend on y_ppem. Now that we treated SFNTs with color bitmaps as scalable as Fontconfig decrees, going by the y_ppem is wrong in this case. We must scale those 4 metrics based on the requested size. Incidentally, Cairo already does this internally for its own metrics, since we are passing this requested size to Cairo, so we were disagreeing with in this particular case too. This patch fixes that up, so the line heights are now actually correct, rather than based on the original y_ppem (which for Noto Color Emoji is the huge 109 value, hence the observed bug).
Assignee | ||
Updated•7 years ago
|
Has STR: --- → yes
status-firefox53:
--- → affected
status-firefox54:
--- → affected
status-firefox55:
--- → affected
status-firefox-esr45:
--- → affected
status-firefox-esr52:
--- → affected
OS: Unspecified → Linux
Hardware: Unspecified → All
See Also: → 1360862
Comment 12•7 years ago
|
||
In Firefox 53 I notice a change in the render of characters with the Noto Color Emoji font. Now the characters will not scale down, and will take all the extra line-height observed in the previous Firefox versions.
Updated•7 years ago
|
Attachment #8866011 -
Flags: review?(jfkthame) → review+
Comment 13•7 years ago
|
||
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/75cf7bb24193 fix line heights to properly scale to requested size for color-bitmapped SFNTs. r=jfkthame
Comment 14•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/75cf7bb24193
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Assignee | ||
Comment 15•7 years ago
|
||
David, can you verify if this is fixed in the latest central?
Flags: needinfo?(dbaron)
Assignee | ||
Comment 16•7 years ago
|
||
Comment on attachment 8866011 [details] [diff] [review] fix line heights to properly scale to requested size for color-bitmapped SFNTs Approval Request Comment [Feature/Bug causing the regression]: Old pre-existing condition. So affects all channels. [User impact if declined]: Third-party emoji fonts will not be spaced correctly on Linux. [Is this code covered by automated tests?]: no [Has the fix been verified in Nightly?]: yes [Needs manual test from QE? If yes, steps to reproduce]: no [List of other uplifts needed for the feature/fix]: This is necessary to combine with the uplifts already in bug 1360682 to resolve recent issues with both scaling and spacing of third-party emoji fonts. [Is the change risky?]: low risk [Why is the change risky/not risky?]: Only affects third-party emoji fonts (not the builtin emoji), and only on Linux. [String changes made/needed]: none
Attachment #8866011 -
Flags: approval-mozilla-esr52?
Attachment #8866011 -
Flags: approval-mozilla-beta?
Comment 17•7 years ago
|
||
Hi Brindusa, is this issue you can help verify in the latest Nightly build? Thanks!
Flags: qe-verify+
Flags: needinfo?(brindusa.tot)
Comment 18•7 years ago
|
||
I tried to verify this on Ubuntu 16.04 x64 and I could not reproduce the initial issue on latest Nightly build 55.0a1, from 05-15-2017 and on Nightly build 55.0a1 from 05-06-2017. Tried with the attached test case in comment 2 and with the link from comment 12: http://emojipedia.org/unicode-9.0/. In my case, on both Nightly builds the emoji looks exactly the same. David, could you please check on your side to see if this is fixed on the latest Nightly?
Flags: needinfo?(brindusa.tot)
Reporter | ||
Comment 19•7 years ago
|
||
I temporarily uncommented the contents of my 65-emoji.conf, and confirmed that: * the bug was still present in the 2017-05-09 Linux nightly * the bug is no longer present in the 2017-05-11 Linux nightly and therefore I've verified that this bug was fixed in the range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b21b974d60d3075ae24f6fb1bae75d0f122f28fc&tochange=d8762cb967423618ff0a488f14745f60964e5c49
Status: RESOLVED → VERIFIED
Flags: needinfo?(dbaron)
Comment 20•7 years ago
|
||
Comment on attachment 8866011 [details] [diff] [review] fix line heights to properly scale to requested size for color-bitmapped SFNTs Fix a "Noto Color Emoji" font issue and was verified. Beta54+. Should be in 54 beta 9.
Attachment #8866011 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 21•7 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/7067d6a7dc74d854498ff5f45a45b74431e21160
Comment 22•7 years ago
|
||
based on comment 19
Comment 23•7 years ago
|
||
Comment on attachment 8866011 [details] [diff] [review] fix line heights to properly scale to requested size for color-bitmapped SFNTs as in bug 1360862, esr52-
Attachment #8866011 -
Flags: approval-mozilla-esr52? → approval-mozilla-esr52-
Updated•7 years ago
|
Comment 24•7 years ago
|
||
Reproduced the initial issue using an old Nightly from 2017-02-15 and instructions from comment 0. I verified that the issue is no longer reproducible using latest Firefox 54 beta 9 on Ubuntu 16.04 64bit.
Updated•7 years ago
|
Flags: qe-verify+
Comment 26•7 years ago
|
||
I can reproduce this in Firefox 55 on openSUSE Tumbleweed, though it seems fixed in previous version.
Comment 27•7 years ago
|
||
In Firefox 55, Noto ColorEmoji is blank, though the size is normal. I am not sure if it is the same bug or a new one.
You need to log in
before you can comment on or make changes to this bug.
Description
•