Bug 166113 - FILEOPEN DOCX smart justify: Times New Roman not justified identically to MS Word 2019
Summary: FILEOPEN DOCX smart justify: Times New Roman not justified identically to MS ...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha1+
Hardware: All All
: low minor
Assignee: László Németh
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: DOCX-Smart-Justify
  Show dependency treegraph
 
Reported: 2025-04-09 20:21 UTC by Justin L
Modified: 2025-04-13 14:13 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
forum-mso-en-18077_smartJustify.zip: DOCX file, PDFs and overlay images (4.16 MB, application/zip)
2025-04-09 20:21 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-04-09 20:21:41 UTC
Created attachment 200262 [details]
forum-mso-en-18077_smartJustify.zip: DOCX file, PDFs and overlay images

I ran across this justified document that seems to be fairly simple - just using the Times New Roman font. However, our justification (as of 25.8 master) doesn't match the output I got from MS Word. The smart justify seemed to get worse results starting in 24.8.

During my bibisect, I focused on the first paragraph of the second page. In MS Word it ends with the single word "Soissons." in a line on its own - but in LO it easily fits on the previous line
starting with 24.8 commit 36bfc86e27fa03ee16f87819549ab126c5a68cac
Author: László Németh on Tue Dec 19 11:58:40 2023 +0100
    tdf#119908 tdf#158776 sw smart justify: shrink only spaces

In my PDF comparison, both MS Word 2019 and LO bibisect were running on the same windows machine, so both used the identical Times New Roman font version. (That said, it looks quite different with MS Word 2010 on a different windows box, so it sounds like a bit of a moving target...)

Marking as low priority, since this is mainly just submitted for information and not really as a concerned bug report.

To understand the contents of the PNG files:
- the most useful overlays are prev-import (24.8 oldest) and import (24.8.6) where RED=MS Word 2019 and grayscale is LO.
- the import-compare and export-compare overlays didn't need to be included. In these overlays, RED=24.8.6, BLUE=24.8oldest, and grayscale is MSO - so any red showing suggests a regression.

Found by Collabora's mso-test
Comment 1 László Németh 2025-04-10 19:14:32 UTC
@Justin: many thanks for the report! I think, it will allow to refine the MSO interoperability a lot, e.g. a possible limit on the difference between the space sizes of the  consecutive lines (part of the Knuth-Plass algorithm), or the unnecessary +1 space, or some mistake in handling text portions etc.