Emoji larger than 98px are not displayed
Categories
(Core :: Graphics: Text, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: tobi, Assigned: lsalzman)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0 Build ID: 20180920131237 Firefox for Android Steps to reproduce: Open https://tobireif.com/non_site_stuff/emoji_max-size_test/the_max_emoji_size_in_mobile_firefox62_is_98px.html in Mobile Firefox 62. At font-size 98px, the emoji are shown: https://app.crossbrowsertesting.com/public/ib8393c20a124bac/livetests/14400965/snapshots/z8bdb506801b9bf03607 Open https://tobireif.com/non_site_stuff/emoji_max-size_test/emoji_size_99px.html in Mobile Firefox 62. Actual results: At font-size 99px, the emoji are not shown: https://app.crossbrowsertesting.com/public/ib8393c20a124bac/livetests/14400970/snapshots/z50f2fc8f9b4cfeb0ebc Expected results: The emoji should be displayed up to font-sizes of 146px (the limit of Mobile Chrome 69) or larger if possible. Also see https://tobireif.com/posts/maximum_font_size_for_emoji/
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Confirmed with Firefox 64.0a1 on a Nexus 5x running Android 8.1.0
Comment 2•6 years ago
|
||
Confirmed on a recent 64.0a1 GeckoView Example build as well.
Updated•6 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Jamie, can you look into this? My guess is this is an issue with the Skia font size limits, though I don't have an Android dev environment set up at the moment to investigate myself...
I list some data at https://tobireif.com/posts/maximum_font_size_for_emoji/ , I'd be happy to update the info regarding Mobile Firefox as soon as it supports larger emoji.
Comment 6•5 years ago
|
||
Lee I'm really lost for where to even start looking for this, don't know the skia code at all. Do you have any pointers?
Assignee | ||
Comment 7•5 years ago
|
||
(In reply to Jamie Nicol [:jnicol] from comment #6)
Lee I'm really lost for where to even start looking for this, don't know the skia code at all. Do you have any pointers?
First try and verify that the FillGlyphs call is getting to the DrawTargetSkia, and if so, find out where the request is getting short-circuited inside Skia.
Comment 8•5 years ago
|
||
The code paths for 98px and 99px emoji diverge in SkGlyphRunListPainter::drawForBitmapDevice. For smaller than 98px ShouldDrawAsPath() returns false and we use drawUsingMasks(), which succeeds. For larger than 99px ShouldDrawAsPath() returns true and we use drawUsingPath() which fails.
drawUsingPath() fails in SkScalerContext_CairoFT::generatePath(), where the call to mozilla_LoadFTGlyph (which calls FT_Load_Glyph) fails. I couldn't trace the code any further in to FT_Load_Glyph unfortunately. The return value is 0x24 "Invalid Size Handle", not sure what that means. If I remove the FT_LOAD_NO_BITMAP flag from that call, then the call succeeds, but we still fail somewhere to render anything.
In ShouldDrawAsPath(), there's a call to SkTypeface::hasColorGlyphs(), which if true forces us not to use paths. But on android (and all platforms other than mac by the looks of it) this simply returns false all of the time.
Interestingly, on desktop linux, even when drawing as a path the emojis are rendered absolutely fine. My hunch is that the emoji implementation on Linux is vector-based can be rendered using paths, but emojis on Android (and Mac) are bitmaps so cannot. Does that make sense Lee?
If that is correct, then the solution would be to override SkTypeface::hasColorGlyphs on android to return something sensible rather than always false?
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d96ed1741bde don't draw non-scalable FT faces as paths. r=jnicol
Comment 11•5 years ago
|
||
bugherder |
Reporter | ||
Comment 12•5 years ago
|
||
Thanks!
Description
•