Emojis in terminal emulators

Desktop Environments and Multimedia
Post Reply
Message
Author
ecor6633
Posts: 12
Joined: 2013-11-19 15:03

Emojis in terminal emulators

#1 Post by ecor6633 »

Hello,

I'm using fluxbox as desktop manager and was used to konsole as my terminal emulator but recently I installed starship prompt which is supposed to display nice emojis.
I discovered that colored emojis are working fine in gnome-terminal by default, but they are in monochrome in xterm and even nearly not working at all in konsole.

Gnome-terminal:
Image
Xterm:
Image
Konsole:
Image

Could somebody explain where and how all of this is supposed to be configured ?

I've read a bit about font-config and it seems well configured by default in debian Buster but wonder why it would have so different behaviors.

reinob
Posts: 935
Joined: 2014-06-30 11:42

Re: Emojis in terminal emulators

#2 Post by reinob »

check which font you are using in each of your terminals.
emojis are just text characters (Unicode code points, to be precise), so you need a font which provides the emojis you need.

ecor6633
Posts: 12
Joined: 2013-11-19 15:03

Re: Emojis in terminal emulators

#3 Post by ecor6633 »

Hello,

The only font which works with emojis seems to be Noto Color Emoji but this one doesn't fit well for console with monospaced and the worst of all the numbers in that font appear with shady grey which is nearly impossible to read on a black background.

I'v placed now a file named 56-nono.conf in ~/.config/fontconfig/conf.d with the following content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

  <match target="font">
    <test name="family" compare="eq">
      <string>Noto Serif</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Noto Serif Display</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>serif</string>
    </edit>
  </match>
  <match target="pattern">
    <test qual="any" name="family">
      <string>serif</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Noto Color Emoji</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>Noto Serif Display</string>
    </edit>
  </match>

  <match target="font">
    <test name="family" compare="eq">
      <string>Noto Sans</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Noto Sans Display</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>sans-serif</string>
    </edit>
  </match>
  <match target="pattern">
    <test qual="any" name="family">
      <string>sans-serif</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Noto Color Emoji</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>Noto Sans Display</string>
    </edit>
  </match>

  <match target="font">
    <test name="family" compare="eq">
      <string>Noto Sans Mono</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Noto Sans Mono</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>monospace</string>
    </edit>
  </match>
  <match target="pattern">
    <test qual="any" name="family">
      <string>monospace</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Noto Color Emoji</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>Noto Sans Mono</string>
    </edit>
  </match>

  <alias binding="strong">
    <family>emoji</family>
    <default>
      <family>Noto Color Emoji</family>
    </default>
  </alias>
</fontconfig>
My konsole is better and I'm happy with this configuration though I still have weird behavior in nomachine for example and other softs that seem to fallback somehow on a weird config with a bery large spacing between letters:
Image

Post Reply