Bug 506403 - Commenting on MS Windows embeds huge Segoi Emoji font, increasing file size by > 6 MB.
Summary: Commenting on MS Windows embeds huge Segoi Emoji font, increasing file size b...
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (other bugs)
Version First Reported In: 24.12.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-30 17:39 UTC by Klaus
Modified: 2025-10-08 15:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Example document for testing. (193.71 KB, application/pdf)
2025-06-30 17:39 UTC, Klaus
Details
Similar cpmment with Adobe Reader. (387.22 KB, application/pdf)
2025-06-30 17:40 UTC, Klaus
Details
Similar comment with PDF XChange Editor. (201.87 KB, application/pdf)
2025-06-30 17:40 UTC, Klaus
Details
Commented on Linux (491.16 KB, application/pdf)
2025-06-30 17:41 UTC, Klaus
Details
Commented on Windows; Part 1 of 2 due to file size limit. (3.71 MB, application/pdf)
2025-06-30 17:44 UTC, Klaus
Details
Commented on Windows; Part 2 of 2 due to file size limit. Use "cat" to combine. (3.29 MB, application/octet-stream)
2025-06-30 17:45 UTC, Klaus
Details
Commented after setting "Typewriter Tool" to use "Courier New". No font embedding beyond those already embedded. (195.99 KB, application/pdf)
2025-06-30 17:54 UTC, Klaus
Details
Commented after setting "Typewriter Tool" to use "Courier New", and editing the comment. Segoe UI gets embedded for no (intended) reason. (752.49 KB, application/pdf)
2025-06-30 17:55 UTC, Klaus
Details
Commented on Open Suse 15.6, with "Helvetica" as intended font. Instead, Roboto Regular gets embedded. (575.15 KB, application/pdf)
2025-10-08 15:24 UTC, Klaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus 2025-06-30 17:39:05 UTC
Created attachment 182803 [details]
Example document for testing.

SUMMARY

On Windows, commenting causes the huge "Segoe UI Emoji" font to get embedded, even after deleting the user profile. This may be symptom of a more general font handling issue for comments (see "Additional Information").


STEPS TO REPRODUCE

1. Create some PDF document, e.g. from LibreOffice or "Save as PDF" in Chrome. For a single PDF page, these range between a few dozen KB, and ~200 KB. An example is attached (194 KB).
2. Delete the user profile in %APPDATA%.
2. Add a typewriter comment on MS Windows and save the document.
3. Redo the same on Linux. Here using "env HOME=$PWD okular" works instead of deleting the profile.


OBSERVED RESULT

1. On Linux the file now has a size of about 492 KB, up by a factor of 2.5.
2. On Windows it has upwards of 7,174 (!) KB, up by a factor of more than 30 (!).

When looking at details of the file (specifically "font info" in Sumatra PDF), only the Windows version lists "Segoe UI Emoji". Segoe UI Emoji is a large font, with the TTF file being 12 MB, which would explain the size difference (assuming the font file is compressed or partially stripped inside the PDF).


EXPECTED RESULT

1. The increase in file size should be similar regardless of operating system.
2. Additionally, even on Linux the resulting file size significantly exceeds the file size when commenting with Windows-only PDF tools like Adobe Reader (388 KB) and PDF XChange Editor (202 KB using Courier New font).


SOFTWARE/OS VERSIONS (Windows)

Okular: 24.12.3
KDE Frameworks: 6.11.0
Qt: Using 6.8.1 and built against 6.8.1
Windows 11 Version 24H2
Build ABI: x86_64-little_endian-llp64
Kernel: winnt 10.0.26100


SOFTWARE/OS VERSIONS (Linux)

Operating System: openSUSE Leap 15.6
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.4.0-150600.23.25-default (64-bit)
Graphics Platform: offscreen
Processors: 12 × Intel® Xeon® E-2136 CPU @ 3.30GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Quadro P620/PCIe/SSE2


ADDITIONAL INFORMATION

I also observed, that on Windows Okular always swaps back to "Segoe UI" when editing a comment, regardless of what the font of the comment originally was. So the root cause of getting the Emoji font involved might be a general font handling issue for comments.

On Linux, using a clean user profile brought the file size with comment down from 790 KB to 492 KB. On Windows, deleting %APPDATA%\okular actually *increased* the file size from 6,617 KB to 7,174 KB.
Comment 1 Klaus 2025-06-30 17:40:11 UTC
Created attachment 182804 [details]
Similar cpmment with Adobe Reader.
Comment 2 Klaus 2025-06-30 17:40:35 UTC
Created attachment 182805 [details]
Similar comment with PDF XChange Editor.
Comment 3 Klaus 2025-06-30 17:41:17 UTC
Created attachment 182806 [details]
Commented on Linux
Comment 4 Klaus 2025-06-30 17:44:50 UTC
Created attachment 182807 [details]
Commented on Windows; Part 1 of 2 due to file size limit.
Comment 5 Klaus 2025-06-30 17:45:17 UTC
Created attachment 182808 [details]
Commented on Windows; Part 2 of 2 due to file size limit. Use "cat" to combine.
Comment 6 Klaus 2025-06-30 17:54:48 UTC
Created attachment 182809 [details]
Commented after setting "Typewriter Tool" to use "Courier New". No font embedding beyond those already embedded.

When setting the font for the "Typewriter" tool to "Courier New", no extra fonts are added at first. However, the comment is displayed as Segoe UI. Any edit to the existing comment will cause Segoe UI to get embedded on the next save (but at least not Segoe UI Emoji).
Comment 7 Klaus 2025-06-30 17:55:35 UTC
Created attachment 182810 [details]
Commented after setting "Typewriter Tool" to use "Courier New", and editing the comment. Segoe UI gets embedded for no (intended) reason.
Comment 8 Klaus 2025-07-01 09:02:42 UTC
Related: https://bugs.kde.org/show_bug.cgi?id=503529
Comment 9 Klaus 2025-10-08 15:24:07 UTC
Created attachment 185604 [details]
Commented on Open Suse 15.6, with "Helvetica" as intended font. Instead, Roboto Regular gets embedded.
Comment 10 Klaus 2025-10-08 15:26:20 UTC
Observed a very similar issue on Open Suse Leap 15.6; Only here I would sometimes get Noto Sans embedded (used as the system GUI font), but when using the example document it was "Roboto Regular" instead.

Okular version: 23.08.5
KDE Frameworks Version 5.115.0
Qt Version 5.15.12 (built against 5.15.12)
PDF Backend Version 0.6.5. Using Poppler 24.03.0