Closed Bug 1661570 Opened 5 years ago Closed 5 years ago

Changes in bug 1371386 break icon webfonts that share Emoji codepoints

Categories

(Core :: Layout: Text and Fonts, defect, P2)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- unaffected
firefox82 + fixed

People

(Reporter: denschub, Assigned: jfkthame)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(1 file)

First, I'm sorry for filing a WebCompat-bug as a regression of a fix that fixes a WebCompat bug. :(

In the patch that landed in bug 1371386, we adjusted the font selection behavior so that the system's emoji font would be preferred over specified fonts if an emoji is to be drawn. Unfortunately, this fix seems to not be web compatible.

I noticed this in an application using the Entypo web font. You can see an example of this at http://fontello.github.io/entypo/demo.html - in Firefox, some icons are rendered using the emoji font, others are rendered from the icon font. All icons here should be in a consistent style and always black and white. Chrome and Safari render the example correctly.

[Tracking Requested - why for this release]:

This is a change in behavior that regressed at least one icon webfont and could break a range of icon fonts. Entypo is affected, and while I'm not aware of other icon fonts that share the emoji range, this is probably not good and doesn't match other browsers.

Flags: needinfo?(jfkthame)

Sigh.... there's just no pleasing everyone!

Chrome and Safari render the example correctly

On the other hand, neither Chrome nor Safari gets the examples in bug 1371386 as correct as we do now. :)

Anyhow....maybe a good heuristic here would be that if there's a webfont in the explicit font-family list that supports the codepoint, then we should accept that choice even if it doesn't match the "preferred" (per Unicode properties) emoji- or text-style rendering, on the grounds that if the author has named a specific font resource, they really do expect that font to be used.

I'll put together a patch to try that and see how things look.

Severity: -- → S2
Flags: needinfo?(jfkthame)
Priority: -- → P2

(We could also argue that if the author explicitly does not want a color-emoji font to be used for Unicode codepoints that are specified to have emoji-style presentation by default, they should have used the U+FE0E variation selector to express their preference for a text-style rendering. But let's see if we can make improvements to our heuristics so as to magically do "the right thing" in more cases.)

I'm also happy to do a bit more digging into other web-iconfonts to gauge how big the issue is. Font Awesome has no issues, none of the fonts at fontello.com have issues, and Entypo got its last update in 2015 and the download links on the website are dead. Although it probably would be hard to estimate how many sites are using Entypo...

I suppose we (or Google?) may have web-crawl data that would in theory make it possible to get an idea. But I think we can do something to make our behavior smarter here, so let's see how that goes.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

The change I'm proposing here (in the attached patch) is to distinguish between cases where there is an explicit requirement in the encoded text for emoji-style rendering, because the Emoji-style variation selector has been used or a skin-tone modifier is present, and cases where the choice of emoji-style rendering is the default according to Unicode property data, but not explicitly called for by the text.

In the explicit case, we'll continue to prefer a color font (if available), but for characters where the choice of color-emoji rendering is just a Unicode default, this patch will allow the author-specified webfont (such as an icon font) to be used even if this means we don't get the color glyph that would normally be expected from font fallback. The assumption is that if the author has specified a certain font resource (not just relying on the system's installed fonts), they really do want that font to be used.

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4ed43385c9b2 Allow webfonts to be used for emoji-default codepoints even if they don't provide color glyphs. r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: