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?
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.
<?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
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
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>