Bug 166357 - LibreOffice Writer and Impress stores and reads wrong font weights
Summary: LibreOffice Writer and Impress stores and reads wrong font weights
Status: RESOLVED DUPLICATE of bug 35538
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.2.1 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-26 15:27 UTC by Zirneklītis
Modified: 2025-04-27 07:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Document before saving (24.33 KB, image/png)
2025-04-26 15:30 UTC, Zirneklītis
Details
The document saved and opened (23.96 KB, image/png)
2025-04-26 15:31 UTC, Zirneklītis
Details
PDF exported from newly created document. (268.50 KB, application/pdf)
2025-04-26 21:32 UTC, Zirneklītis
Details
PDF exported from re-opened document. (239.60 KB, application/pdf)
2025-04-26 21:33 UTC, Zirneklītis
Details
Saved example. (21.78 KB, application/vnd.oasis.opendocument.text)
2025-04-26 21:34 UTC, Zirneklītis
Details
Saved example (safe mode) (21.94 KB, application/vnd.oasis.opendocument.text)
2025-04-26 21:34 UTC, Zirneklītis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zirneklītis 2025-04-26 15:27:49 UTC
Description:
Both “LibreOffice Writer” and “LibreOffice Impress” stores wrong font
weight values. The saved document containing a font with all acceptable
font weights (“Thin” (100); “Ultra Light, Extra Light” (200); “Light”
(300); “Regular, Normal” (400); “Medium” (500); “Semi Bold, Demi Bold”
(600); “Bold” (700); “Extra Bold, Ultra Bold” (800); “Heavy, Black”
(900)) has wrong weight values in the “content.xml” file.

The wrong values are for three font weights:
- “Ultra Light, Extra Light” (200): fo:font-weight="150";
- “Light” (300): fo:font-weight="250";
- “Medium” (500): fo:font-weight="normal".

So there is no surprise that some of the font weight information is
lost on reopening the document.

I have tried both the ODP or ODT file to unzip and replace these wrong
values with the correct ones in the “content.xml” file. Zipped them and
renamed. No luck. The fonts weights are not the same as they should be.


Steps to Reproduce:
1. For writing text, use font which besides regular weight has at least Medium font weight.
2. Change some characters to Medium weight.
3. Save, close and open document.


Actual Results:
The Medium font weight is changed to Regular weight.


Expected Results:
The document should look as it was before closing.



Reproducible: Always


User Profile Reset: No

Additional Info:
Creates document with wrong weight values.
Comment 1 Zirneklītis 2025-04-26 15:30:25 UTC
Created attachment 200542 [details]
Document before saving
Comment 2 Zirneklītis 2025-04-26 15:31:23 UTC
Created attachment 200543 [details]
The document saved and opened
Comment 3 m_a_riosv 2025-04-26 16:56:42 UTC
Please, where is the sample file?

Please test in safe mode, Menu/Help/Restart in Safe Mode

Please paste here the information on Menu/Help/About LibreOffice (There is an icon to copy)
Comment 4 Zirneklītis 2025-04-26 21:31:21 UTC
$ ./soffice --version
LibreOffice 25.2.2.2 7370d4be9e3cf6031a51beef54ff3bda878e3fac

Version: 25.2.2.2 (X86_64) / LibreOffice Community
Build ID: 7370d4be9e3cf6031a51beef54ff3bda878e3fac
CPU threads: 4; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: lv-LV (lv_LV.utf8); UI: en-US
Calc: threaded

Safe-mode gives the same result.
Comment 5 Zirneklītis 2025-04-26 21:32:47 UTC
Created attachment 200549 [details]
PDF exported from newly created document.
Comment 6 Zirneklītis 2025-04-26 21:33:37 UTC
Created attachment 200550 [details]
PDF exported from re-opened document.
Comment 7 Zirneklītis 2025-04-26 21:34:17 UTC
Created attachment 200551 [details]
Saved example.
Comment 8 Zirneklītis 2025-04-26 21:34:48 UTC
Created attachment 200552 [details]
Saved example (safe mode)
Comment 9 Zirneklītis 2025-04-26 21:40:00 UTC
LibreOffice 7.6.2.1 has already this bug. Not sure which version is earliest.
Comment 10 m_a_riosv 2025-04-27 07:48:59 UTC

*** This bug has been marked as a duplicate of bug 35538 ***