Emojis aren't displayed

Hi there :wave:

I’m having some trouble displaying emojis on QTerminal but also with FeatherPad and a Python/Qt app I wrote.

I’m not familiar with the functioning of fonts and emojis on linux. Noto color emoji is installed by default and supports emojis but the font font itself looks very bad. I want to use the font of my choice and still get the support of emojis. How is it meant to work and can I achieve this? And why I’m I the only one to meet this issue? :crying_cat_face:

lubuntu 24.04
LTS LXQt 1.4.0
french locale

Thanks a lot _🙏

Noto Color Emoji (…) only works in Android, Google Chrome, Windows 10 and in apps that support the CBDT format.

This text is cited from

1 Like

Not tested but this seems to be a fontconfig issue, or at least one with its default configuration:

You may need to rebuild the font cache for it to take effect:

If this does work, I’d love to know. I can’t help but think this should just be a part of the defaults for fontconfig, but that would also take testing it in every other flavor to be sure there are no unintended side effects.

1 Like

Hi @wxl thanks for pointing me on the right direction. Using this https://manpages.ubuntu.com/manpages/trusty/en/man5/fonts-conf.5.html I made this file

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <!-- For colored emojis: -->
 <match target="pattern">
  <test name="family">
   <string>monospace</string>
  </test>
  <edit mode="assign" name="family">
   <string>Noto Color Emoji</string>
  </edit>
 </match>
</fontconfig>

(note the “assign” instead of “append” otherwise the black and white emojis are are displayed when they exist)

Doing this I’m able to correctly display emojis on Qterminal and FeatherPad :tada:

I’m still working on the Qt application : labels aren’t displaying color emojis even when I set the default font to monospace. I’ll complete this thread if I find something interesting and I’m still taking any insights :sweat_smile:

1 Like

I tried both ad2ien conf file and the one in lxqt-issues-627.
They both seem to work on 24.04.

(the file goes in ~/.config/fontconfig/conf.d/99-emoji.conf)

3 Likes

On a side note, to type in emoticons, rather than use unicode hex codes
i.e Ctrl-Shift-U, (which doesn’t mostly work for QT apps),
I used instead a Compose key;
setxkbmap -option compose:rctrl
sets the Right-Ctrl key for a compose_key.
This .XCompose file in your home dir;
will define compose sequences for emojis
e.g <compose_key> <colon> <colon> <D>
:grinning:

2 Likes