Bug 481211 - Konsole does not show emojis correctly
Summary: Konsole does not show emojis correctly
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 24.01.95
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-11 12:31 UTC by Iyán Méndez Veiga
Modified: 2024-02-23 01:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Finish emoji from pdm not shown properly in Konsole (81.40 KB, image/png)
2024-02-11 12:31 UTC, Iyán Méndez Veiga
Details
Emojis pasted from emoji selector shown as empty squares (18.00 KB, image/png)
2024-02-11 12:32 UTC, Iyán Méndez Veiga
Details
Konsole & Yakuake profiles (431.96 KB, image/png)
2024-02-11 20:31 UTC, Iyán Méndez Veiga
Details
Konsole with Noto Color Emoji (610.94 KB, image/png)
2024-02-11 20:31 UTC, Iyán Méndez Veiga
Details
Konsole profile weird font Complex Text Layout (298.65 KB, image/png)
2024-02-11 20:46 UTC, Iyán Méndez Veiga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Iyán Méndez Veiga 2024-02-11 12:31:46 UTC
Created attachment 165742 [details]
Finish emoji from pdm not shown properly in Konsole

SUMMARY
Konsole does not show emojis correctly, while Yakuake does using the same profile and fonts


STEPS TO REPRODUCE
1. Open emoji selector (Super + .) and copy any emoji
2. Paste in Konsole and Yakuake

OBSERVED RESULT
Yakuake shows all emojis correctly. It also show emojis printed by applications (e.g. pdm). Konsole also shows empty squares (see attached screenshots)

EXPECTED RESULT
Konsole should work just as fine as Yakuake

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LENOVO
Product Name: 20XYCTO1WW
System Version: ThinkPad X1 Yoga Gen 6
Comment 1 Iyán Méndez Veiga 2024-02-11 12:32:13 UTC
Created attachment 165743 [details]
Emojis pasted from emoji selector shown as empty squares
Comment 2 fanzhuyifan 2024-02-11 20:10:10 UTC
What font are you using for konsole? Could you provide a screenshot of konsole-edit current profile-appearance? You would need to select a font that supports emojis, like Noto Color Emoji
Comment 3 Iyán Méndez Veiga 2024-02-11 20:31:03 UTC
If I select Noto Color Emoji, then the emoji works but also some normal characters like numbers are shown with emojis (I will attach a screenshot), so this font is not really usable. This issue I already had with Plasma 5.x and I put screenshots in the Matrix #Plasma room some time ago. I'm using Hack 10pt for the profile. For some reason, Yakuake takes the emojis from a font that includes them while Konsole cannot, even though both are using the same profile.
Comment 4 Iyán Méndez Veiga 2024-02-11 20:31:29 UTC
Created attachment 165757 [details]
Konsole & Yakuake profiles
Comment 5 Iyán Méndez Veiga 2024-02-11 20:31:44 UTC
Created attachment 165758 [details]
Konsole with Noto Color Emoji
Comment 6 fanzhuyifan 2024-02-11 20:35:55 UTC
Ahh I think I know what is going on -- could you go to edit current profile -- appearance -- complete text layout and check what is selected for the emoji font?
Comment 7 Iyán Méndez Veiga 2024-02-11 20:46:17 UTC
Exactly, that was it! I changed the "default" options (weird -1) to Noto Color Emoji and now everything works as expected. By the way, this also fixed the issue on my PC running Plasma 5.25.10. How could that setting got that weird value? The PC installation is quite recent, and in my laptop that I upgraded to Plasma 6 RC 2, I deleted the .config folder to have a "cleaner" experience.
Comment 8 Iyán Méndez Veiga 2024-02-11 20:46:40 UTC
Created attachment 165759 [details]
Konsole profile weird font Complex Text Layout
Comment 9 fanzhuyifan 2024-02-11 21:49:03 UTC
So the problem is not with the apparent size of -1 -- it is with the code not correctly handling when to set a default emoji font.
Comment 10 Bug Janitor Service 2024-02-11 21:49:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/955
Comment 11 Iyán Méndez Veiga 2024-02-11 21:50:58 UTC
Cool, nice catch! Thanks for fixing it so quick
Comment 12 Kurt Hindenburg 2024-02-23 01:33:48 UTC
Git commit dad9085e58ada8434cae24118c76e1f2d31a352a by Kurt Hindenburg, on behalf of Yifan Zhu.
Committed on 23/02/2024 at 01:11.
Pushed by hindenburg into branch 'master'.

terminalDisplay/TerminalFonts: fix checking if emojiFont is set

QFont() constructs a font object that uses the application's default
font. So testing if a font is set by comparing it against QFont() is not
valid. Instead, test if the family name is empty.

M  +2    -2    src/terminalDisplay/TerminalFonts.cpp

https://invent.kde.org/utilities/konsole/-/commit/dad9085e58ada8434cae24118c76e1f2d31a352a