Created attachment 167846 [details] Size differences between the original document and the one with the typewriter annotations SUMMARY I was going to sign a PDF document using Okular but found that after signing it using the Typewriter annotations feature the resulting PDF document's file size becomes >15MiB. It turns out that Okular embeds the ENTIRE font file of the Chinese font I'm using but not a subset of it required by the annotation text itself, making the resulting file size 260x than the original. This is a serious problem as: * The resulting file will likely no longer be attachable to an e-mail due to the oversized file. * The resulting file may no longer be legally distributed as it may violate the license of the embedded font(only subset distribution of the glyphs is allowed). STEPS TO REPRODUCE 1. Open a PDF document, and note the original file size of the file. 2. Add a Typewriter annotation that consists of characters that can only be rendered by a big-scaled font (e.g. Chinese by "Noto Sans CJK"). 3. Save the PDF document. OBSERVED RESULT The entire Chinese font(instead of its subset) is embedded in the document(as per the attached screenshot). EXPECTED RESULT Okular should embed the subset of the font required to render the Typewriter annotations by default, or at least provide an option to opt-off the current behavior. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Okular 24.02.1 Flatpak @ Ubuntu 23.10 Desktop (available in About System) KDE Plasma Version: 5.27.8 KDE Frameworks Version: Flatpak: 6.0.0 @ Host: 5.110.0 Qt Version: Flatpak: 6.6.2 @ Host: 5.15.10 ADDITIONAL INFORMATION Use [the Static Super-OTC variant of the Noto Sans CJK font](https://github.com/notofonts/noto-cjk/releases/download/Sans2.004/00_NotoSansCJK.ttc.zip) creates a PDF document that is 1233x of the original file's size.
Created attachment 167847 [details] The screenshot of the Fonts tab of the PDF properties dialog
Created attachment 167851 [details] The source HTML document used to produce the POC.orig.pdf (the file is generated using the output as PDF function of the print dialog of the web browser)
(In reply to 林博仁(Buo-ren, Lin) from comment #0) > Use [the Static Super-OTC variant of the Noto Sans CJK > font](https://github.com/notofonts/noto-cjk/releases/download/Sans2.004/ > 00_NotoSansCJK.ttc.zip) creates a PDF document that is 1233x of the original > file's size. Which is ~91.1MiB to be specific, which is NOT a reasonable file size for a single-page PDF document that contains only 2 glyphs of the Chinese characters.