Bug 496661

Summary: Exporting markdown to PDF loses emojis
Product: [Applications] okular Reporter: Iizuki <kv3f5ves>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: CONFIRMED ---    
Severity: minor CC: aacid, kv3f5ves, viktor.tempelfeld
Priority: NOR    
Version First Reported In: 24.08.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: An exmaple markdown file with an emoji
.md file with emoticons

Description Iizuki 2024-11-25 09:09:32 UTC
SUMMARY

Emojis are displayed correctly when viewing a markdown file with Okular, but if you export the file to PDF, emojis will be lost.

STEPS TO REPRODUCE
1. Open a markdown file with some emojis in it.
2. Export it to PDF: File > Export As > PDF

OBSERVED RESULT

PDF has no emojis at all. Not even the "missing boxes".


EXPECTED RESULT

PDF should have emojis, just as the rendered markdown file.


SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 
Qt Version: 6.8.0

ADDITIONAL INFORMATION
Comment 1 Albert Astals Cid 2024-11-28 15:16:47 UTC
Please attach such a markdown file.
Comment 2 Iizuki 2024-12-01 10:07:42 UTC
Created attachment 176258 [details]
An exmaple markdown file with an emoji
Comment 3 Albert Astals Cid 2024-12-01 22:20:29 UTC
Works for me.

Which doesn't make much sense since i'm also using archlinux packages for this test.
Comment 4 Iizuki 2024-12-09 17:31:43 UTC
That is weird yeah, but it gave me a debugging idea.

I have the following configuration in `/home/iizuki/.config/fontconfig/fonts.conf`:

```xml
<?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>
   </prefer> 
 </alias>

 <alias>
   <family>serif</family>
   <prefer>
     <family>Noto Serif</family>
     <family>Noto Color Emoji</family>
     <family>Noto Emoji</family>
   </prefer>
 </alias>

 <alias>
  <family>monospace</family>
  <prefer>
    <family>Noto Mono</family>
    <family>Noto Color Emoji</family>
    <family>Noto Emoji</family>
   </prefer>
 </alias>
</fontconfig>
```

The point is just to use color emojis where-ever possible.

Disabling that conf makes the export work, only with a black and white teapot emoji before and after. The files exported with the conf enabled still don't show anything. There's just no (selectable) character in the PDF.
Comment 5 Viktor 2025-08-28 21:16:47 UTC
Created attachment 184540 [details]
.md file with emoticons

I have the same problem in EndeavourOS. Emoticons are lost when converting from .md to .pdf. I am attaching an .md file with emoticons. Check it out for yourself.
Comment 6 Viktor 2025-08-28 21:20:43 UTC
The uploaded file does not look the same as I uploaded it. It had the following content:
📞 1  
✉️ 2  
💬 3  
🏠 4  
🌍 5  
❤️ 6  
🙂 7
Comment 7 Albert Astals Cid 2025-09-01 17:46:32 UTC
Interesting i can reproduce the issue now, i wonder if i did not test it properly the first time.