Issue 3243 - improve justification by condensing spaces as well as expanding
Summary: improve justification by condensing spaces as well as expanding
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: 641
Hardware: PC All
: P3 Trivial with 46 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2002-02-27 22:15 UTC by mwdiers
Modified: 2017-05-20 11:29 UTC (History)
7 users (show)

See Also:
Latest Confirmation in: ---
Developer Difficulty: ---

Comparsion of Microsoft Word (left side) with 2.0 (right side) (35.26 KB, image/png)
2006-01-01 11:51 UTC, martinkozak
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description mwdiers 2002-02-27 22:15:36 UTC
In most high-end page layout programs, including Pagemaker, InDesign,
QuarkXpress, and also in Word Perfect 6.x and later, justified text is handled
far more intelligently than it is in OpenOffice, and Microsoft Word (at least as
it is set by default).

Currently in, when text is justified, the line breaks appear to
be made as follows:

If the current word will not fit, try to hyphenate it (assuming hyphenation is
turned on). Otherwise, move it to the next line, and increase the spacing
between words on the current line to fill out the line.

The result is that justified text looks uneven from line to line. Microsoft
Word, by default, justifies text in this same way.

A better way to handle justification (known as Full Justification in Word) is as

Assign a minimum word-spacing value, relative to point size. When justifying a
given line of text, check first to see if the current word spacing can be
condensed, to fit the given word on the current line. If it can, do so, if not,
hyphenate or move the word to the next line and expand word spacing on the
current line.

This behavior can be duplicated in Microsoft Word by doing the following: Tools,
Options, Compatibility, Do Full Justification Like WordPerfect 6.x for Windows.

The result is much more professional looking layout. Also, page space is used
more effiently.

(Note: When you turn on Full Justification in Word, the onscreen results look
poor, as the WYSWYGI engine only condenses the later part of the line onscreen.
However, it looks great when printed.)
Comment 1 stefan.baltzer 2002-02-28 15:02:52 UTC
Reassigned to Christian.
Comment 2 christian.jansen 2003-02-11 16:25:00 UTC
Reassigned to Bettina.
Comment 3 t8m 2003-03-29 10:08:38 UTC
Openoffice could use (probably optionally) the line-breaking algorithm
from the typographical system TeX. This would be a major enhancement
over the competition.
Comment 4 martinkozak 2006-01-01 11:51:42 UTC
Created attachment 32811 [details]
Comparsion of Microsoft Word (left side) with 2.0 (right side)
Comment 5 christofarn 2006-02-24 12:07:44 UTC
I'm very interested in this issue, because I love openoffice and use it
professionally. But to produce perfect documents in justification is nearly
impossible. Wordspacing is realy to loose. (The workaraound is to format all
spaces smaller.) If I can help anything, by testing or however, let me know!
Comment 6 pesala 2006-10-10 20:22:14 UTC
Agreed. This is an important issue for better typesetting, especially on narrow 

1. Reduce/increase spacing between words 
2. Reduce/increase spacing between letters.

I found this issue when looking for an issue on the non-breaking spaces. This is 
also illustrated in the attachment. Non-breaking spaces are not expanded as they 
should be. A non-breaking space is identical to a space character, except that it 
does not break at the margin. It is not a fixed width space like em-space or figure-
Comment 7 duveneck 2007-02-08 16:49:36 UTC
Using the TeX algorithm is a good idea. Scribus, the open-source DTP program, 
is also implementing such an algorithm in its upcoming release, so code could 
also be lifted from there.

There are signs that Word may also implement such an algorithm in its next 
release: the new Windows Presentation Foundation (WPF) includes a very 
interesting, impressive, and freely usable algorithm called "optimal 
paragraph." See:
Comment 8 christofarn 2007-07-06 11:07:41 UTC
This issue is important to make a professionally more and more
used software - and it's really important for myself. Please let me know, if I
can help in any way [I'm not really rich, I haven't much time left, but both
isn't zero ;-) ].
Two questions: Shouldn't this issue be assigned to all platforms and all OS's,
not PC and Windows 2000 only? And: What would it depend from, that this issue
could change it's status from "NEW" to "STARTED"? (as it's "aged" and important
at the same time)
Comment 9 bettina.haberer 2007-09-26 16:01:49 UTC
Hi Mathias, I have changed the current owner to your owner. Please take the
ownership of these enhancements.
Comment 10 discoleo 2008-04-29 22:09:23 UTC
Indeed, the justification is quite poor inside OOo.

These are some valid options, as previously mentioned.
1. Reduce/increase spacing between words 
2. Reduce/increase spacing between letters.

I would also add:
3. Scale width of the characters on the particular line

The algorithm should run like this:
1.) current word does NOT fit
2.) compress spaces up to 50% of original space
    [value will be probably dependent on font size, too]
  \/ still does NOT fit

3.) lower the 'Scale width' of the characters up to 95%
    decrease spacing between letters
  \/ still does NOT fit

4.) wrap word on next line
  \/ space on previous line increases to over 2x default space

5.) hyphenate word IF hyphenation is on

Implement an advanced Justification-analysis tool:
 - should inspect lines for major discrepancies
   -- report lines with space > 2x default space
   -- report line-pairs, where one line is compressed
      and the other is expanded to > 1.5x default space
   -- maybe some other more advanced features

My problem is, that in order to justify a text professionally, I have to format
every line separately (setting custom 'Scale widths'), which makes any use of
styles impossible.
Comment 11 pesala 2008-04-30 04:29:10 UTC
For details of how InDesign does multiline composition see: In Depth: Text and 
Comment 12 christofarn 2008-11-16 07:00:50 UTC
Since 2002 (?) this Issue is referred to Platform PC and OS Windows 2000, which
is false. This issue concerns all plattforms and all operating systems.
Comment 13 Mathias_Bauer 2008-11-18 15:08:06 UTC
Thanks for the hint. Adjusted.
Comment 14 christofarn 2009-08-17 15:12:14 UTC
Could I help in any way to solve this issue? I'm beginner programmer in python,
I can spend a small amount of money, I could help decide the algorithm, since I
know a very high qualified typesetter, that is specialised in how lose or narrow
spaces between word and letters should be.
This issue is very important to me, because I produce printed matter using ooo.
Until now, I always have to find workarounds - or to turn a blind eye.
Please tell me!
Comment 15 irneb 2009-08-17 15:36:29 UTC
Issue 74715 may be dependent on this. Although it doesn't even consider the
justification of a paragraph, it does show the problem with OOo's current text
rendering. Even just left justified paragraphs don't align with each consecutive
line. It's as if each character has a varying bleed space around it.
Comment 16 wexfordpress 2010-12-25 15:12:19 UTC
The following enhancements, in order of priority are needed:
1. adopt the TeX paragraph at a time justification algorithm
2. allow space between words to be reduced as well as expanded
3. Optical alignment, sometimes called hanging punctuation
4. Microtypography, where justification is assisted by minor changes in the
width of characters.
5. Set looseness of paragraphing, either globally or per paragraph.

TeX has all of these. Scribus has 2, 3 and 4. OO Writer has zero of these. 
John Culleton
Comment 17 Marcus 2017-05-20 11:29:17 UTC
Reset assigne to the default "".