Bug 167298 - Add visualization to justified lines exceeding maximum word spacing
Summary: Add visualization to justified lines exceeding maximum word spacing
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: László Németh
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Paragraph-Alignment
  Show dependency treegraph
 
Reported: 2025-06-30 12:37 UTC by László Németh
Modified: 2025-07-16 17:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot: enabled word spacing indicator (370.12 KB, image/png)
2025-07-16 17:27 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2025-06-30 12:37:31 UTC
Description:
Similar to Hyphenation & Justification tools of DTP software, add visualization for  bad typesetting, i.e. lines with too big word spacing.

Steps to Reproduce:
Check a justified text.

Actual Results:
It's possible to find only the lines with very big spaces easily, because it's depend on the context, too.

Expected Results:
Add a tool, which visualize the lines with bad typography better, comparing their spaces to the maximum word spacing set in the paragraph.


Reproducible: Always


User Profile Reset: No

Additional Info:
See e.g. Hyphenation and Justification Violations in Adobe InDesign.
Comment 1 Commit Notification 2025-06-30 16:03:36 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c05bc38067b2ab61ae919fb1fef1381343d03844

tdf#167298 tdf#166113 sw word spacing: add word spacing indicator

It will be available in 26.2.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.
Comment 2 Buovjaga 2025-07-04 13:26:09 UTC
Can this be closed as fixed?
Comment 3 László Németh 2025-07-16 14:04:02 UTC
Commit description with instruction for usage (this feature needs enabled ShowWordSpacingIndicator expert configuration option, non-100% word spacing in paragraph justification yet, not only enabled formatting marks):

tdf#167298 tdf#166113 sw word spacing: add word spacing indicator

tdf#167298: As an advanced feature for typography and related
development – including bug fixing –, add visualization for
justified text lines with too big word spacing.

tdf#166113: fix bInteropSmartJustify by adding bFullJustified
to avoid unnecessary extra calculation for the last paragraph line.
(Regression since commit 529755f0919217a84a12daad0fddfddd1124f0e9
"tdf#166113 sw smart justify: adjust algorithm for interoperability",
detected by the word spacing indicator).

The red word spacing indicator line is positioned before
the justified text line, and its width is the extra space
of a space character over the maximum word spacing.

For example, if the font-defined space width is 3 pt,
the maximum word spacing is 150%, spaces expanded to 6 pt in
the justified line results a 6 pt - 3 pt * 1.5 = 1.5 pt width
word spacing indicator.

To enable the word spacing indicator in a justified text,

1) Open "Tools" -> Options" -> "Advanced" -> "Open Expert Configuration";

2) search for "ShowWordSpacingIndicator";

3) double-click on the config entry (or press Enter) to set it to True;

4) Enable Formatting Marks (Control-F10).
Comment 4 László Németh 2025-07-16 14:05:21 UTC
(In reply to Buovjaga from comment #2)
> Can this be closed as fixed?

Yes, I closed it now, thanks for the question!
Comment 5 László Németh 2025-07-16 17:27:36 UTC
Created attachment 201820 [details]
screenshot: enabled word spacing indicator

on test document of Bug 166113.