Description: Enabling "font embedding" with "only used fonts" works, if the used fonts appear in the main document body (see use_in_body.odt). It does not work, if the fonts only appear in the header of footer. In this case, these fonts are not included in the file. (see use_in_header_only.odt). Additionally, the files are immensely bloated due to the inclusion of the font "Fonts\Font_NSimSun_1.ttf" which is a Chinese font not included in the document at all. Steps to Reproduce: 1. create a file with a non-standard font in the header 2. enable "embedding fonts" in document settings 3. safe file. re-open on device without the specified font (or unzip the *.odt and check the folder "Fonts". Actual Results: Font if used only in header is not embedded. Expected Results: Font should be embedded, so the file is displayed correctly on other systems. Reproducible: Always User Profile Reset: Yes Additional Info: Version: 25.2.2.2 (X86_64) / LibreOffice Community Build ID: 7370d4be9e3cf6031a51beef54ff3bda878e3fac CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: threaded
Created attachment 200851 [details] File with font in header only, embedded font missing. Bloated with unneeded font.
Created attachment 200853 [details] File with font in body, font is correctly embedded. Additional unnecessary font also included.
I repeated the procedure on another computer, where it behaved flawlessly and as expected. Version: 7.5.1.2 (X86_64) / LibreOffice Community Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129 CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: CL threaded
I confirmed. and bisected Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 69ed893087f89d176a5ec4b263ce8d75774be72b CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: ja-JP (ja_JP); UI: ja-JP Calc: CL threaded author Mike Kaganski commit 69ed893087f89d176a5ec4b263ce8d75774be72b tdf#160253: fix list identifier export decision code > Additionally, the files are immensely bloated due to the inclusion of the font > "Fonts\Font_NSimSun_1.ttf" which is a Chinese font not included in the document at all. please try uncheck asian font.
https://gerrit.libreoffice.org/c/core/+/185704
(In reply to win from comment #0) > Additionally, the files are immensely bloated due to the inclusion of the > font "Fonts\Font_NSimSun_1.ttf" which is a Chinese font not included in the > document at all. The inclusion of NSimSun is correct, because it *is used* in your files - it is set as Asian font in the *used* styles. The bug was that it wasn't included previously, that was bug 155486, and its essence was that when the font didn't specify exact matches for "regular"/"bold"/"italic"/"bold italic" variants (which is fine, and LibreOffice can use that font, and correctly synthetize the variants), then embedding failed. That was fixed in 7.6. As Saburo suggested, the proper procedure is to exclude Asian fonts, if you don't need them.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e61a179b4ff8ce2072c3c0780628eb38c7a43529 tdf#166627: embed fonts everywhere we emit font data It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8ebe1e51ea9be20dd3e2279359ca0bebc9beb05c Related: tdf#166627 Write font-face-src for each mention of embedded font It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for looking into the issue. Using the latest daily build (25.8.0.0.alpha1) on Windows: I confirm unchecking "Embed Asian fonts" solved the unnecessary inclusion of the Asian font . The problem with fonts occuring only in the header not being embedded persists. I now observed that from the two fonts in the body, only the second font is included (see use_in_body_25.8.0.0.a1.odt).
Created attachment 200978 [details] Second font in body not being embedded. I now observed that from the two fonts in the body, only the second font is included (see use_in_body_25.8.0.0.a1.odt).
(In reply to win from comment #9) > Using the latest daily build (25.8.0.0.alpha1) on Windows: > I confirm unchecking "Embed Asian fonts" solved the unnecessary inclusion of > the Asian font . This was not the issue, and this was working always; confirming this fact does not mean the actual issue is solved. So given that you write later: > The problem with fonts occuring only in the header not being embedded > persists. you should not mark this "VERIFIED". However, you do not use the "latest" daily. Your version (that you used for authoring attachment 200978 [details]) is marked 3158b14e0b26875300a8098bc117a5e69b76f48f (and its moment is 2025-05-23 06:10:34 UTC+2, i.e. early morning of May 23rd), while the fixing commit e61a179b4ff8ce2072c3c0780628eb38c7a43529 was merged on 2025-05-23 22:48:56 UTC+2 (i.e., that same day, but in evening). So you were nit testing the fix. Please re-test.