Justification Spacing Issues

I’m writing a book and trying to format it for publication. As such, I’m using Justified alignment. However, there are often lines with unprofessional levels of spacing between words (with hyphenation turned on). I read some old posts that say LOW justifies based on individual lines rather than paragraphs, which would make sense with what I’m seeing.

Version: 7.3.1 (x64)
Windows 10
Saving as an .odt, printing as a .pdf

The document uses direct formatting, but I’ve tested with styles and seen the same issue.

Is there any fix for this?

Please, basically you have to specify the operating system and the LibreOffice version (three digits, e.g. 7.3.2).
Furthermore, specify the file type in which you saved.
Edit your initial question, to do it. Thanks.

No problem. Edited as requested.

1 Like

I’m writing a book and trying to format …

Thank you for your valuable information.
Please also specify in your initial question whether you format exclusively with styles. Thank you very much.


Professional text composition with Writer

English documentation

No problem. I updated with that as well.

1 Like

Could you please describe in factual words what you mean? I.e. in objective terms like quantity of space (absolute size or percentage on line width or word length). As such, it is a subjective opinion and we can’t help much.

It is likely also that fixing the issue in direct formatting context will require a tremendous effort while this is easy in styling context.

The last line of text here is what I mean - https://i.imgur.com/nDfp2r9.png

Removing direct formatting and styling is fine if that’s what I need to do.

Not a very helpful screenshot, no formatting marks showing View > Formatting marks Ctrl+F10. My guesses:

  • There is a line break or many spaces inserted after “customer”
  • Hyphenation is not turned on for that paragraph
  • You are using a language for which you don’t have a hyphenation dictionary, or document language is set to None. Select all and set to a language with a hyphenation dictionary.

My sample
JustifiedHyphenated80948.odt (14.4 KB)

With which values?

@EarnestAl - Thanks for that. None of those seem to be the case, but I see your sample working fine. I copy+pasted the full paragraph in question to the attached .odt.
sample story.odt (23.5 KB)

@LeroyG

What should we look at in your sample story.odt? Seems to be correct.

The next word after customer is "stormed’, there is nowhere to split it that would fill the spaces in the line above. Words should be split between syllables Hyphen - Wikipedia

1 Like

I only see that I have not the EB Garamond font.
imagen

The issue isn’t that it’s not splitting stormed, but that LOW doesn’t seem to adjust space elsewhere in the paragraph. In this image, the top is LOW, the bottom is another program that pulls “him” up a line to make room for “stormed out”. The spacing is much better.

@LeroyG - Oops, sorry about that. I forgot EB Garamond was a downloaded font from Google’s library.
@ajlittoz - There’s too much spacing in between words on the 4th line for a professionally formatted book.

Well, I see a double problem here.

  • Font metrics
    EB Garamond appears to have a specific metrics which is not equivalenced to any font on my computer (and I don’t intend to download it). From available information, it was last updated in 2011 and I’d question its compatibility with today’s font formats. It is of course still usable but font renderers may interpolate some of its properties.
    Using Liberation Serif (because by default substituted font is chosen in a Sans family), I can approximate your first line by reducing font size to 11.9pt (instead of 12pt). The first three lines are then wrapped like your screenshot. Unfortunately, “stormed out” is not pulled from next line and I have wide inter-word spacing.
    Applying now character spacing -0.4pt pulls “stormed” but not “out”, resulting in single orphan word “day” on last line, with different line wrap and hyphenation in intermediate lines.
    Setting character spacing to -0.5pt is excessive (“stormed out of his” are pulled in) and gives overall a bad-looking paragraph because glyphs are visually too close to each other.

  • Justification algorithm
    From what I understand in Writer, when a line is justified, spaces are always expanded. In the case of your fourth line (with font size 11.3pt and null character spacing), pulling an extra word would require to shrink a bit inter-word spacing. Apparently, this is not done by the present algorithm.
    You might file an enhancement request with a prospective specification. The hot point is to determine the acceptable limit on space contraction. It is obvious that shrinking to 10% the initial space width is not acceptable.
    Perhaps a mixed criteria like “if expanded space is more than x% the base width, attempt to shrink spaces no less than y% before falling back to computed expanded space”.

Solving your problem may go through changing font face (I hope your book is fully styled otherwise this will be a nightmare) to benefit from the latest font features format. You may also cheat a bit on font size (if the print shop accepts it), reducing it to 11.5pt at most.
I don’t think playing with character spacing is a promising track because it impacts all text and usually results in mangled characters. Fonts have been designed for a specific spacing with kerning tables tuned for this spacing. You’ll ruin all aesthetics in the font if you mess this up.

1 Like

image

I think that shrink or not it is easy to test. With the two following paragraphs, the upper one left aligned, and the lower one justified, and see the difference.

“white collared shirt and khakis. Just yesterday, his boss yelled at”
“white collared shirt and khakis. Just yesterday, his boss yelled at him for”

No shrink in Writer; I can’t test in the “another program”. :slight_smile:

See also: tdf#119908 and tdf#38159

Here is what I mean - https://i.imgur.com/nDfp2r9.png

Besides the wide word spacing there is letter spacing issues in there. That indicates the EB Garamond in your system came from an earlier or non-standard source, and doesn’t have kerning tables in place, or they’re badly corrupt from the current release.

“EB Garamond” has several releases from different sources. Which version are you using? And scrap answering that because knowing which version is actually in the PDF is hard, and then figuring out where it came from is hard because some of the releases with edits look exactly the same.

Uninstall EB Garamond, then get EB Garamond from Google Fonts, and then ensure kerning is enabled. Install the separate face files, not the Variable font. If you need EB Garamond Math (what that image looks like) you need to segregate the math version from the paragraphs. If you have captions or footnotes get EB Garamond 08 from Font Library and use that for the captions. It’s not quite as finished as the Google Font, but it fits best where you need low ascenders.

And I did find that EB Garamond isn’t nearly as elastic as it needs to be for justified text and requires more manual correction. I’m still using LO 6.4, but I think my setting tools won’t have changed.

Word spacing has only 2 acceptable settings for EB Garamond: 0.0 and -0.1pt word spacing. Less than that letters start colliding, and more than that is worse than the word spacing issue you already see.

Beyond that Inserting hard breaks (control-return) or no break spaces (either program a key or use the insert->formatting mark->Nobreak space) to force hyphenation. In extreme cases you can seek non vertical letter edges like “o” and “A” and push the word spacing hard there, but I’ve run into issues that more than one word spacing value within a paragraph causes unstable reflow on reload sometimes, so I don’t use this on longer works and only do it when I’m going to print soon.

If you can deal with ragged right text, The result will be more readable, and look better. That’s just how Garamond is designed… it doesn’t have much wiggle room before it optically looks bad. If you go visit a bookstore and look through the choices in this type of genre, I think you’ll be surprised that justified text does not have a monopoly.

Looking at your sample a bit further it’s unclear that kerning is on by default. When I open your sample it seems to be kerning on my system, but the images of the problem text seems to show its not enabled on your system. And this will answer are you using the right font too:

In the page style dialog on the font tab, there is a “features…” button. The last feature is Horizontal kerning. When I enabled this, on LO 6.4 it also shows 'frac=1" which i think makes all numbers superscript. then subscript… so Enable horizontal kerning in the features and note that the font name now has :kern or :frac=1&kern. If you see the latter, you want to remove the frac=1& manually from the font. If you don’t see kerning on the list of features…