Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1006685: kde-plasma-desktop: KDE does not display Emojis correctly

703 views
Skip to first unread message

Max Görner

unread,
Mar 2, 2022, 6:50:03 AM3/2/22
to
Package: kde-plasma-desktop
Version: 5:111
Severity: normal

Dear Maintainer,

for several years KDE on Debian seems to be unable to display emojis
correctly. I experience this problem on Debian testing and on Debian stable.

One can reproduce it by running `echo "Heart Face Emoji 🥰"` in Konsole
or by opening https://www.youtube.com/watch?v=YaYoJziCgto in Fireofox or
Konqueror. The emojis will be displayed only as blank rectangles.

The problem does not occur on Ubuntu. It also does not occur when using
Debian/Xfce and when using the Xfce-Terminal from within a Plasma
session. Thus, I can have a Konsole and Xfce-Terminal side by side with
the former showing the problem and the latter not so.

I reproduced the problem by setting up a Debian/Testing in a virtual
machine yesterday.

I tried to set a different font, but to no avail. Maybe I have not tried
hard enough. However, I think Emojis should be displayed properly in the
default configuration.


-- System Information:
Debian Release: 11.2
APT prefers stable
APT policy: (990, 'stable'), (500, 'stable-security'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.16.10 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=de:en_GB
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages kde-plasma-desktop depends on:
ii kde-baseapps 4:20.12.0+5.111
ii plasma-desktop 4:5.20.5-4
ii plasma-workspace 4:5.20.5-6
ii udisks2 2.9.2-2+deb11u1
ii upower 0.99.11-2

Versions of packages kde-plasma-desktop recommends:
ii kwin-x11 4:5.20.5-1
ii sddm 0.19.0-3
ii xserver-xorg 1:7.7+22

Versions of packages kde-plasma-desktop suggests:
ii kdeconnect 20.12.3-2

-- no debconf information

Norbert Preining

unread,
Mar 2, 2022, 8:50:03 AM3/2/22
to
Hi Max,

> One can reproduce it by running `echo "Heart Face Emoji 🥰"` in Konsole
> or by opening https://www.youtube.com/watch?v=YaYoJziCgto in Fireofox or
> Konqueror. The emojis will be displayed only as blank rectangles.
>
> The problem does not occur on Ubuntu. It also does not occur when using
> Debian/Xfce and when using the Xfce-Terminal from within a Plasma

Qt has not auto-fallback, so this has to be activated for fontconfig.
I just tried it myself on Arch (I am running) and didn't see the emojis.
Then I did:
- install fonts-noto-emoji
- added configuration to /etc/fonts/local.conf (easily findable on the
internet what is necessary)
And now emojis are properly shown in konsole, as well as other Qt based
programs.

> I tried to set a different font, but to no avail. Maybe I have not tried
> hard enough. However, I think Emojis should be displayed properly in the
> default configuration.

The problem is that:
- the default font you set is for text, and emojis are most likely not
contained in the font you set
- the libraries in use need to deal with missing glyphs in the defined
font, and there are several ways to do it. One is to display TOFU

This is not specific to KDE, but to fontconfig and how Debian handles
fallback fonts.

Best

Norbert

--
PREINING Norbert https://www.preining.info
Fujitsu Research + IFMGA Guide + TU Wien + TeX Live
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13

Max Görner

unread,
Mar 3, 2022, 4:10:03 AM3/3/22
to
Hi Norbert,

thank you very much for your reply.

> [...]
> - added configuration to /etc/fonts/local.conf (easily findable on the
> internet what is necessary)
I really tried, but I could not find a guide how to do so. I found
https://wiki.archlinux.org/title/Font_configuration but it seems not to have a
section to configure fallback fonts.

Could you point me to a guide or maybe post your XML snippet here? It would
help me a lot.

>
> This is not specific to KDE, but to fontconfig and how Debian handles
> fallback fonts.
So maybe this is not related to KDE directly, but I still think its an
unfortunate situation, and fixing at would significantly improve the user
experience? Would it make sense to file another bug report against the
appropriate package, e.g. fontconfig?


Best regards
Max Görner

Norbert Preining

unread,
Mar 3, 2022, 5:10:03 PM3/3/22
to
Hi Max,

> I really tried, but I could not find a guide how to do so. I found
> https://wiki.archlinux.org/title/Font_configuration but it seems not to have a
> section to configure fallback fonts.

I used a different config file, but just found this here which indicates
that it is related to hinting:

https://bugs.freedesktop.org/show_bug.cgi?id=104542

$ cat /etc/fonts/conf.d/68-color-emoji.conf

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<test name="family" compare="contains">
<string>Emoji</string>
</test>
<edit name="hinting" mode="assign">
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
<edit name="embeddedbitmap" mode="assign">
<bool>true</bool>
</edit>
</match>
</fontconfig>

$

Does that work (after sudo fc-cache -f and relogin)?

If not, then

<?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>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
</fontconfig>

Would help, too.

> So maybe this is not related to KDE directly, but I still think its an
> unfortunate situation, and fixing at would significantly improve the user
> experience? Would it make sense to file another bug report against the
> appropriate package, e.g. fontconfig?

My guess is that the fonts-noto-emoji or so should ship a fontconfig
file that activates it, best with the above.

But I am not running Debian anymore on my main machine, so cannot really
check.

Max Görner

unread,
Mar 4, 2022, 4:50:03 AM3/4/22
to
Hi Norbert,

>I used a different config file, but just found this here which indicates
>that it is related to hinting:
>
>https://bugs.freedesktop.org/show_bug.cgi?id=104542
Thank you very much for finding this.

Meanwhile, I had a look at how Kubuntu is configured in this regard.

I copied two files from Kubuntu's /etc/fonts/conf.avail/, 50-user.conf and
56-kubuntu-noto.conf and put them to Debian's /etc/fonts/conf.avail and
~/.config/fontconfig/conf.d/, respectively.

Then I refreshed the fonts cache using `sudo fc-cache -fv`, just as you
suggested. For everyone landing here: **It was crucial to relogin!**

Now I have working emoji support wherever I expect it. Thank you very much!

I could not find a primary source for both files, so I attached them to this
e-mail. Hopefully they will arrive in Debian's bug ticket frontend.


>> So maybe this is not related to KDE directly, but I still think its an
>> unfortunate situation, and fixing at would significantly improve the user
>> experience? Would it make sense to file another bug report against the
>> appropriate package, e.g. fontconfig?
>
>My guess is that the fonts-noto-emoji or so should ship a fontconfig
>file that activates it, best with the above.
I will open a bugreport for that package.


Again, thank you very much for your help. I think this bug report can be
closed now.


Best Regards
Max Görner
50-user.conf
56-kubuntu-noto.conf

Norbert Preining

unread,
Mar 4, 2022, 9:40:03 AM3/4/22
to
Hallo Max,

> I copied two files from Kubuntu's /etc/fonts/conf.avail/, 50-user.conf and
> 56-kubuntu-noto.conf and put them to Debian's /etc/fonts/conf.avail and
> ~/.config/fontconfig/conf.d/, respectively.
>
> Then I refreshed the fonts cache using `sudo fc-cache -fv`, just as you
> suggested. For everyone landing here: **It was crucial to relogin!**

So yes, re-logging in is probably necessary indeed.

I checked the two files, the 50-user.conf should not be necessary since
this is already present in Debian, too ... if it is missing on your
side, this is surprising.

Concerning 50-kubuntu-noto.conf, this does *a hell of a lot of things*
... if you are happy with the output, then all is fine. The part that it
does right is adding the Noto emoji font to the search list at the
front. (I personally found some interesting things concerning hinting
for CJK fonts, which - as I live in Japan - is of great interest!)

> Now I have working emoji support wherever I expect it. Thank you very much!

Well, if it works and all is fine with you, that is perfect!

All the best
0 new messages