Bug 126154 - Make space between words configurable to increase readability (minimum, desired and maximum word spacing)
Summary: Make space between words configurable to increase readability (minimum, desir...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: Paragraph-Alignment
  Show dependency treegraph
 
Reported: 2019-06-29 08:03 UTC by jojobader
Modified: 2025-05-14 11:46 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
tdf126154.fodt: test document (27.46 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-04-25 14:32 UTC, László Németh
Details
tdf126154.pdf: PDF export of the test document (45.16 KB, application/pdf)
2025-04-25 14:34 UTC, László Németh
Details
screenshot: Word spacing options in Paragraph settings dialog window -> Alignment -> Justification (57.25 KB, image/png)
2025-04-25 14:40 UTC, László Németh
Details
tdf126154_minimum_shrinking.fodt: unit test document for fixing minimum word spacing (27.56 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-05-08 16:52 UTC, László Németh
Details
tdf126154_portion.fodt: unit test document with text portion (31.18 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-05-13 08:07 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jojobader 2019-06-29 08:03:29 UTC
There is no way to change the spacing between words, and i think it's a very important setting, given that the space between words that LO uses atm, is just very small. Reading something in LO is way more tiresome than reading in Calibre's Bookviewer for example, where the spacing is bigger which increases the readibility a lot. There is a sweet spot, but that's propably very subjective.

Anyway, i wanted to request this overlooked feature and urge everybody to look into comparisons about short and long spacing between words. Here's is just one article that talks about that: https://creativepro.com/the-complete-guide-to-word-spacing/

Regards!

jojo
Comment 1 V Stuart Foote 2019-06-29 15:25:09 UTC
Controlling interword spacing to optimize legibility should be possible, but would depend on how much dev effort it would need to implement/refactor.

Otherwise isn't this out of scope for an office suite, trending deep into the realm of Desktop Publishing? And not clear the work it would require is justified.

IIUC we work simply with spacing derived from font metrics, with some limited ability in GUI to adjust glyph kerning, or apply kashida, for intraword spacing

Paragraph justification works against the margin settings to distribute word spacing, and revise hyphenation when needed.

While "register true" is applied at the page margins to assure paragraph lines align page to page.

Who knows, perhaps some HarfBuzz magic?
Comment 2 Regina Henschel 2019-06-29 16:35:59 UTC
You can already scale the width of spaces manually. I think any thing beyond that, is out of scope for an office suite.
Comment 3 V Stuart Foote 2019-06-29 20:26:14 UTC
(In reply to Regina Henschel from comment #2)
> You can already scale the width of spaces manually. I think any thing beyond
> that, is out of scope for an office suite.

@Regina, you've stumped me. Nothing obvious in GUI, nor in Expert Configuration stanzas. So, where is the user control to "scale the width of spaces"?
Comment 4 Regina Henschel 2019-06-29 21:29:55 UTC
@V Stuart Foote: You can mark the space and then use Format > Character. Then use tab "Position". It has the option "Rotation/Scaling" and there "scale width". I use a reduced width on a non-breaking space between number and unit to reduce the distance between number and unit.
Comment 5 V Stuart Foote 2019-06-29 22:09:48 UTC
(In reply to Regina Henschel from comment #4).

@Regina a bit hackish, but you are right we can use Find & Replace to find all Spaces--then from the Character dialog scale the selection--just the spaces. 

But looking at Flat ODT result, see a T1 defined with a scale of 300%, and then every word in the paragraph is broken by a text span holding the space with its scaling. Also, interesting in that when showing NPC the blue dot for the spaces are also scaled/stretched, weird. Just not sure that would be functional for folks in general. Every space baloons into a 46 character <text:span>, and breaks up the paragraph. Thanks though! -- Stuart
Comment 6 V Stuart Foote 2019-06-29 22:15:17 UTC
s/just the spaces./just the spaces at 300%.
Comment 7 Regina Henschel 2019-06-29 22:47:18 UTC
There exists a CSS property "word-spacing". https://www.w3schools.com/cssref/pr_text_word-spacing.asp or https://developer.mozilla.org/en-US/docs/Web/CSS/word-spacing. It exists in XSL-fo too, but not in ODF. https://www.w3.org/TR/xsl/#word-spacing
Comment 8 Heiko Tietze 2019-07-11 18:12:02 UTC
Let's close it as WF based on comment 2 (if you replace one space by two per find/replace it has the same effect as scaling to 200%). Plus, readability comes with the font and we shouldn't compensate for a "creative" kerning.
Comment 9 László Németh 2025-04-24 23:05:09 UTC
This is not only a CSS/XSL feature, but default in DTP software to increase readability. For example, the default minimum, desired and maximum word spacing (e.g. 80%, 100%, 133%) of DTP software can limit hyphenation and optimize text layout simultaneously, making more readable text.
Comment 10 Commit Notification 2025-04-25 07:54:39 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5a48070f5904c51dc9e7bbad4213d802fd4bc89b

tdf#126154 sw offapi xmloff cui: add min/max word spacing

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.
Comment 11 László Németh 2025-04-25 14:32:37 UTC
Created attachment 200514 [details]
tdf126154.fodt: test document

Section 1 (only desired word spacing: 100%): 5 hyphenated lines
Section 2 (minimum word spacing: 80%, desired: 100%): 1 hyphenated line
Section 3 (monimum: 80%, desired: 100%, maximum: 133%): no hyphenated line
Comment 12 László Németh 2025-04-25 14:34:52 UTC
Created attachment 200515 [details]
tdf126154.pdf: PDF export of the test document
Comment 13 László Németh 2025-04-25 14:40:02 UTC
Created attachment 200516 [details]
screenshot: Word spacing options in Paragraph settings dialog window -> Alignment -> Justification
Comment 14 László Németh 2025-05-08 16:52:35 UTC
Created attachment 200704 [details]
tdf126154_minimum_shrinking.fodt: unit test document for fixing minimum word spacing

Paragraph 2 of Section 2 and 3 was broken not after the hyphenated word "bulum", but after the following 1-letter word "c" (it was greedy shrinking, i.e. choosing the furthest, not the nearest space to the desired word spacing).
Comment 15 Commit Notification 2025-05-08 16:59:54 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3dd2d7f449f13bec0f0a5c6e0c33a143409c3723

tdf#126154 sw word spacing: fix greedy space shrinking

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.
Comment 16 Hossein 2025-05-08 21:15:07 UTC
Thanks László for implementing this feature.

Is this something related to tdf#155707?

tdf#155707 - Implement justified/justify low/medium/high paragraph alignments 
https://bugs.documentfoundation.org/show_bug.cgi?id=155707
Comment 17 Commit Notification 2025-05-12 09:55:42 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/01d1037262070ae4ab37868bb47f6ac258433618

tdf#126154 tdf#149420 tdf#165984 sw: fix hyphenation zones with portions

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.
Comment 18 László Németh 2025-05-13 08:00:44 UTC
(In reply to Hossein from comment #16)
> Thanks László for implementing this feature.
> 
> Is this something related to tdf#155707?
> 
> tdf#155707 - Implement justified/justify low/medium/high paragraph
> alignments 
> https://bugs.documentfoundation.org/show_bug.cgi?id=155707

Hossein: thanks for your kind feedback! It seems, enabling bigger word spacing for these DOCX settings can fix Kashida visualization, too, so I did that, fixing also its DOCX round-trip. I will comment it in Bug 155707.
Comment 19 László Németh 2025-05-13 08:07:12 UTC
Created attachment 200770 [details]
tdf126154_portion.fodt: unit test document with text portion

A test document for the fixed minimum word spacing, paragraph end zone and hyphenation zone. No hyphenation is in all text lines at underlined words.
Comment 20 Commit Notification 2025-05-14 11:46:39 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/41d3574263d90f1872ff0bad74618761e84d0f61

tdf#126154 sw word spacing: fix greedy shrinking regression

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.