Closed Bug 1066933 Opened 10 years ago Closed 9 years ago

Unicode characters break Emoji Color

Categories

(Core :: Graphics: Text, defect)

x86_64
Windows 8.1
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 1032671
Tracking Status
firefox32 --- affected
firefox33 --- affected
firefox34 --- affected
firefox35 --- affected

People

(Reporter: invision.rsps, Unassigned)

References

()

Details

Attachments

(2 files)

Attached image report.png
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20140910030204

Steps to reproduce:

Firefox 35.0a1(and possible some previous version?) have support for colored emoji unicode character. Under most circumstances it works properly, I have discovered a way to break it.

Create a string of "emoji" unicode characters:
Severity: normal → minor
Iteration: --- → 35.1
Component: Untriaged → General
See detail http://forums.mozillazine.org/viewtopic.php?f=23&t=2868485
Blocks: 889401
Component: General → Graphics: Text
Product: Firefox → Core
Version: 35 Branch → Trunk
Iteration: 35.1 → ---
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file emoji_color.html
Looks like a font fallback problem [1]. The fontinfo add-on [2] reveals the font in use is Segoe UI Symbol, rather than Segoe UI Emoji.

See the attached testcase:
1. There's no issue if Segoe UI Emoji is expressly specified. Setting "Fonts for: Other Languages" to "Proportional: Sans Serif; Sans-serif: Segoe UI Emoji" also solves the problem.
2. This only affects certain emoji. Presumably that's because the others aren't available in the Segoe UI Symbol font, so Firefox picks Segoe UI Emoji.

[1] See bug 1054780 since it has the potential to make this worse.
[2] https://addons.mozilla.org/firefox/addon/fontinfo/
The emoji characters generally rely on system font fallback, as we don't currently have an explicit font preference for them.

I assume what's happening here is that we hit this code in gfxFontGroup::FindFontForChar:

6026     // 3. use fallback fonts
6027     // -- before searching for something else check the font used for the previous character
6028     if (aPrevMatchedFont && aPrevMatchedFont->HasCharacter(aCh)) {
6029         *aMatchType = gfxTextRange::kSystemFallback;
6030         nsRefPtr<gfxFont> ret = aPrevMatchedFont;
6031         return ret.forget();
6032     }

which means that if the immediately-preceding character came from Segoe UI Symbol, and the emoji codepoints in question are also available in Segoe UI Symbol, then we'll continue using that rather than falling back to Segoe UI Emoji, as we otherwise would for the emoji codepoints in isolation.
This will be fixed by bug 1032671.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: