Bug 167673 - FILEOPEN DOCX: balanceSingleByteDoubleByteWidth affecting spaces that it shouldn't (MS Word affected by preferred proofing language)
Summary: FILEOPEN DOCX: balanceSingleByteDoubleByteWidth affecting spaces that it shou...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: lowest minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks: DOCX
  Show dependency treegraph
 
Reported: 2025-07-25 20:48 UTC by Justin L
Modified: 2025-07-25 21:45 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sbcs_minimal.docx: a single line of heavily spaced text (22.77 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-07-25 20:48 UTC, Justin L
Details
Screenshot from Word 365 (221.71 KB, image/png)
2025-07-25 21:08 UTC, Jonathan Clark
Details
Screenshot showing layout is affected by user config (403.21 KB, image/png)
2025-07-25 21:22 UTC, Jonathan Clark
Details
sbcs_minimal_Word2024.pdf: how it looks in "Home and Business 2024" (18.33 KB, application/pdf)
2025-07-25 21:43 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-07-25 20:48:28 UTC
Created attachment 202002 [details]
sbcs_minimal.docx: a single line of heavily spaced text

Similar to the DOC bug report (bug 167552), this example document has balance-SBCS enabled, but MS Word doesn't seem to honour that compat flag in this particular document.

This started with 25.8 commit 6818bc55ff248c59f12b2e090139eff30fe949dd
Author: Jonathan Clark on Wed Mar 26 14:28:55 2025 -0600
    tdf#88908 sw: Add BalanceSpacesAndIdeographicSpaces compat option
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183412

Unlike for DOC, I haven't found many DOCX examples. This is the only solid DOCX example I found so far that is negatively affected by this commit.

This example comes from minimizing forum-mso-en-10806.docx using Word 2010. I also removed all other compat flags to simplify diagnosis. (Perhaps SBCS also depends on another flag also being set, but I couldn't find one.)

Steps to reproduce:
1. Open sbcs_minimal.docx on a computer that has MS's Calibri font installed. 

The document should contain a single line of text, not wrapped onto two lines.

Found by Collabora's mso-test.
Comment 1 Jonathan Clark 2025-07-25 21:08:30 UTC
Created attachment 202003 [details]
Screenshot from Word 365

Screenshot of the reproducer taken with the desktop version of Word 365 for Windows. The Balance SBCS characters and DBCS characters option is checked, and it is affecting layout.
Comment 2 Jonathan Clark 2025-07-25 21:22:05 UTC
Created attachment 202005 [details]
Screenshot showing layout is affected by user config

Screenshot from Word 365 for Windows, showing that the local config setting for preferred proofing language affects the layout of documents download from other sources. No changes were made to the sample document. No other Word configuration changes were made.
Comment 3 Jonathan Clark 2025-07-25 21:28:28 UTC
Since this is the second time we've had disagreeing results in the desktop version of Word, I wanted to check if it could be due to configuration.

This turned out to be the problem. I had my preferred proofing language set to Japanese. When I switched it to English, the layout changed to what you are reporting it should be.

Hopefully I'm not out of line if I say this is a spectacularly bad engineering decision on Microsoft's part. Users should not have to change their proofing language setting to match the document author's just to view a file correctly.
Comment 4 Justin L 2025-07-25 21:43:01 UTC
Created attachment 202007 [details]
sbcs_minimal_Word2024.pdf: how it looks in "Home and Business 2024"

(In reply to Jonathan Clark from comment #3)
> Since this is the second time we've had disagreeing results in the desktop
> version of Word, I wanted to check if it could be due to configuration.
> 
> This turned out to be the problem...
Interesting (and disturbing). Just for the record, here is my English Word 2024 result.