How to get colour emoji working on GNU/Linux

Despite recent versions of Firefox having colour emoji built in, Debian users will usually see black-and-white emoji characters due to the wrong font being used. ☹️

I wanted to try getting colour emoji working across my whole system, not just Firefox. 🤔

Here is how I did it. ℹ️

Install the emoji font

Before anything else, you'll need to have a colour emoji font installed. The Google Noto font is available in the Debian package repository, so you simply need to run:

apt install fonts-noto-color-emoji

...as root, or via sudo. ⌨️

Uninstall the DejaVu fonts

The DejaVu fonts have black-and-white versions of most emoji, which cause them to get used in place of the colour ones most of the time. The simplest option is to uninstall them:

apt remove fonts-dejavu-core

Make sure that all related packages are removed:

  • fonts-dejavu
  • fonts-dejavu-core
  • fonts-dejavu-extra

Unfortunately, some (non-font) packages - such as blender or openmw - rely on these being installed, so you'll need to uninstall those as well. ⚠️

Add a configuration file

The following is a modified version of the configuration file described in this Github issue by abouvier. Save this as /etc/fonts/conf.d/56-emoji.conf and all should be well:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Color Emoji</family>
      <family>Bitstream Vera Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Noto Color Emoji</family>
      <family>Bitstream Vera Serif</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Noto Color Emoji</family>
      <family>Bitstream Vera Sans Mono</family>
    </prefer>
  </alias>
  <match>
    <test name="family" compare="contains">
      <string>emoji</string>
    </test>
    <edit name="family" mode="prepend" binding="same">
      <string>Noto Color Emoji</string>
    </edit>
  </match>
</fontconfig>

You might need to re-start some program(s) in order for the font configuration changes to take effect, but that's basically it. ☺️

Note: If you don't want to uninstall the DejaVu fonts for whatever reason (maybe you need to keep Blender around?) then you might still be able to get colour emoji by adjusting the name/contents of this configuration file somehow. I can't help you there; you'll need to figure that part out on your own.