Closed Bug 1193481 Opened 6 years ago Closed 6 years ago
Set Firefox Emoji font in Gecko as fallback of !BMP characters
Based on Jonathan Kew comment ing Bug 993899 ============================================ I don't think we should make FirefoxEmoji the default or first font for content in general, just so it'll get used for any emoji codepoints that happen to be present..... this will hurt performance globally, because for the vast majority of content we'll be first testing a font that doesn't support the characters in the text, and only second falling back to a font that's actually usable. What we probably want to do instead is to return FirefoxEmoji from GetCommonFallbackFonts for the appropriate codepoint ranges, so that when an emoji codepoint occurs in the midst of content styled with a standard (text) font, we'll pick the desired fallback. This is what we do for Apple Color Emoji, for example (in gfxPlatformMac::GetCommonFallbackFonts), and for Segoe UI Emoji (in gfx::WindowsGetCommonFallbackFonts). Currently, AFAIK the implementation in gfxAndroidPlatform is shared between Android and B2G, but we do have some #ifdef'd code in there that distinguishes between MOZ_WIDGET_ANDROID and MOZ_WIDGET_GONK. So I think it'd make sense to add a B2G-specific fragment in GetCommonFallbackFonts there and make it prefer the FirefoxEmoji font. It looks like this bug is about implementing the keyboard layout, so I'd suggest filing a new bug (in Core::Graphics:Text) for the Gecko change needed here. It should be a pretty simple patch.
Pavel, how is the FirefoxEmoji font being loaded on the device? I don't see it in the moztt repository; is it being installed into /system/fonts from somewhere, or are the Gaia apps loading it via @font-face?
I think something like this should work, provided that (a) the font is renamed "Firefox Emoji" (with space in the family name), which I believe is the intention; and (b) it's installed on the device as a system font, not just loaded via @font-face.
We load the font by hand for now in /system/fonts ... just for tests to reduce the small fixes. But we will add it in /system/fonts like other fonts. And yes :) I will rename the font after few minuter to "Firefox Emoji" and land it in https://github.com/mozilla/fxemoji/raw/gh-pages/dist/FirefoxEmoji/FirefoxEmoji.ttf Thanks :)
Comment on attachment 8647635 [details] [diff] [review] Prefer "Firefox Emoji" font for emoji characters in GetCommonFallbackFonts on B2G Before moving forward here, we need confirmation of the font (family) name and how it's being installed (is it in the system font list?), but provided those issues are clarified then this should make it the preferred face for the emoji characters it supports. (Depending how complete Firefox Emoji is, we might also want to remove Noto Color Emoji at some point -- it's currently present in moztt -- but I'm assuming we'll leave that for a separate bug.)
Attachment #8647635 - Flags: review?(jdaggett)
Yep I will open a separate bug to put "Firefox Emoji" (FirefoxEmoji.ttf) in moztt repo and remove Noto Color Emoji.
Here is the separated Bug 1194407
https://hg.mozilla.org/integration/mozilla-inbound/rev/8c2c2ce4deaa4f30182df18dfc1ea4c4290ceebf Bug 1193481 - Prefer "Firefox Emoji" font for emoji characters in GetCommonFallbackFonts on B2G. r=jdaggett
Summary: FirefoxEmoji Font - Gecko change needed → Set Firefox Emoji font in Gecko as fallback of !BMP characters
You need to log in before you can comment on or make changes to this bug.