Render emoji in color even if your default font doesn’t want to

In some situations, you may end up with emoji displaying in color in GTK applications but not in Qt ones (such as Kate, Konsole, etc.)

If you’re sure you have a color emoji font installed (e.g. fonts-noto-color-emoji) and still get most emoji in black and white, it might be because your system default font provides black and white emoji already. The color font further down the line is never matched so you get black and white emoji instead.

The cause of this problem is very complicated but the solution is easy: Slap this into your /etc/fonts/local.conf (and maybe run fc-cache -f as root):

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
   <family>sans-serif</family>
   <prefer>
    <family>Noto Sans</family>
    <family>Noto Color Emoji</family>
    <family>Noto Emoji</family>
    <family>DejaVu Sans</family>
   </prefer>
  </alias>
  <alias>
   <family>serif</family>
   <prefer>
    <family>Noto Serif</family>
    <family>Noto Color Emoji</family>
    <family>Noto Emoji</family>
    <family>DejaVu Serif</family>
   </prefer>
  </alias>
  <alias>
   <family>monospace</family>
   <prefer>
    <family>Noto Mono</family>
    <family>Noto Color Emoji</family>
    <family>Noto Emoji</family>
   </prefer>
  </alias>
  <dir>/usr/local/share/fonts</dir>
</fontconfig>Code language: HTML, XML (xml)

Shamelessly stolen from various sources.

Leave a Reply

Your email address will not be published. Required fields are marked *