My website won't use my custom emoji font (Noto Color Emoji), different behaviour in each browser. Why?

Viewed 1296

I'd like to use colored Emojis ony my new project. Therefore I implemented the newest Noto Color Emoji-Font to my project. My backend is in ASP.NET Core btw.

But now I have a strange behaviour when rendering the emojis on my website, every browser renders it differently, therefore I think my font won't get loaded, maybe?

Edge:

Rendering in Edge

Firefox:

Rendering in Firefox

Chrome:

Rendering in Chrome

As it should be:

As it should be

site.css:

/* fonts*/
@font-face {
    font-family: "color-emoji";
    src: local("Noto Color Emoji");
    src: url("./fonts/NotoColorEmoji.ttf");
}
.emoji {
    font-family: 'color-emoji';
}

In my view:

<p class="emoji">‍❤‍ ‍❤‍ ‍❤‍</p>

This particular emoji is just an example btw.

Do you have any ideas? I know why I am a backend developer in my job. Frontend is killing me all the time.

1 Answers

To be on the safe side, one should always use fully-qualified emoji zwj sequences.

Instead of:

<p class="emoji">‍❤‍ ‍❤‍ ‍❤‍</p>

try this:

<p class="emoji">‍❤️‍ ‍❤️‍ ‍❤️‍</p>

‍❤️‍ U+1F469 U+200D U+2764 U+FE0F U+200D U+1F468

‍❤️‍ U+1F468 U+200D U+2764 U+FE0F U+200D U+1F468

‍❤️‍ U+1F469 U+200D U+2764 U+FE0F U+200D U+1F469

Note the U+FE0F VARIATION SELECTOR-16 right after the ❤ U+2764 HEAVY BLACK HEART to form a proper red heart emoji...

You can have a look at the Recommended Emoji ZWJ Sequences, v11.0 web page, or get a full list of all fully-qualified and non-fully-qualified emoji in the emoji-test.txt data file.

Related