"Align left" and "justify" have different number of words on a line

7 replies [Last post]
Sujato
Offline
Last seen: 4 years 9 weeks ago
Title:
Joined: 27 Mar 2012
Posts: 5

Here's my problem in a nutshell. When I change my paragraph formatting from 'align left' to 'justified' LO sometimes shifts some words on to the next line. What it should do is simply stretch the words to fit the full line length. I have done this many times before and it has never been a problem, but this is now wrecking my formatting. The problem occurs if I change the alignment through paragraph styles or if I do it via direct formatting.

Essentially what I want is a command that forces the justification to not shift words on to the next line.

Here's the less nutshelly version. 

I'm using Ubuntu Oneiric 64 bit with the native LO 3.5.1.2.

I've written and published several book using LO. Generally I can do all the things I want to with it, the only serious bugbear being the primitive justification algorithm. This behaves as I mentioned above, and results in highly uneven, unsightly text. 

The only way I have found around this is to manually justify each line. I define character styles with the characters condensed at 0.1, 0.2, and 0.3 inches. I set the paragraph style to align left, manually scan each paragraph, and when a line can be easily compressed, I do that, or I apply manual hyphenation. When I am happy with the results I change the paragraph setting back to 'justified', and voila! a nicely justified, evenly grey text.

The results so far have been pretty good, and certainly much better than the default settings. It is, of course, a time-intensive process, which I don't mind too much as I use it as a chance for another proof-read.

Anyway, when I have done that with the book I'm working on now, the 'justified' version shifts words on to the next line, seemingly arbitrarily. I can't figure out why this happens in some cases and not in others. There seem to be multiple inconsistent causes.

For example, in one particular paragraph, if one word is italicized, then the justified version shifts the last word of that line on to the next line. If it is not italicized it does not. This is despite that fact that the italic text is slightly narrower than the regular. In other places the italicized words don't seem to create this problem. And in other paragraphs the problem has nothing to do with italics.

I suspect the root of the problem is that this is an old document, which has been through countless revisions and transferrals between OSs and so on, and there's a heap of rubbish formatting code retained in the xml. This should theoretically remain inactive, but I suspect it is actually causing this formatting strangeness. I have tried to recreate the bug on other documents but they all work fine.

If I could clean up the rubbish code that might help - any suggestions? 

But the basic problem is simply getting LO to behave as it should: expanding a line of justified text without shifting a word on to the next line.

Here's screenshots of justified and align left text in case my explanation is not clear.

AttachmentSize
leftalignedexample.jpg56.85 KB
Justifiedexample.jpg61.38 KB
oweng
oweng's picture
Offline
Last seen: 5 days 10 hours ago
Title: ==Moderator==
Joined: 26 Jan 2012
Posts: 3281
may be character or font-related
I can't replicate the problem here (Ubuntu 10.04 / same LO version) using the same text set in Gentium font. You may want to check if there are any unusual spacing characters between words, contributing to the odd breaking behaviour. It may also be font-specific, so perhaps try setting the text in a different font (especially for the italic problem you mention). If neither of these work, then I suspect (like you) it is probably cruft in the underlying XML.
Sujato
Offline
Last seen: 4 years 9 weeks ago
Title:
Joined: 27 Mar 2012
Posts: 5
yes, font is an issue...

Thanks, Oweng.

I don't think it's a matter of non-standard spacing characters: I do use some, but it doesn't affect this problem.

I did try some different fonts, and you're right, it makes a difference. I tried Dejavu, Junicode, and Linux Libertine, and all of them do the justification properly. I tried several members of the Gentium family, and the problem recurs in all of them. So it seems to have something to do with a bug in Gentium, which only occurs (so far) in this particular document.

But that doesn't solve my problem. I've used Gentium plenty before, no problems. And I want to use it here. I need a font that will handle diacritical marks, as well as broad typographical capabilities, and there are few of them in the free world. And, well, I just like Gentium.

Not to mention, of course, if I choose a new font that means I have to do all the formatting again - ending up with even more cruft...

oweng
oweng's picture
Offline
Last seen: 5 days 10 hours ago
Title: ==Moderator==
Joined: 26 Jan 2012
Posts: 3281
which font version are you using?
I originally had Gentium v1.502 installed here, but upgrading it to Gentium Plus v1.508 (zip here) still gives me the same result (i.e., I don't see the difference between left aligned and justified). I too like Gentium (for the reasons you give) and use it extensively, so the fact that your problem appears to be Gentium-specific is perplexing. I hope it is not something to do with the font rendering engine in the newer version of Ubuntu (and how it treats Gentium).
Sujato
Offline
Last seen: 4 years 9 weeks ago
Title:
Joined: 27 Mar 2012
Posts: 5
fonts
I'm using the latest versions of gentium plus, gentium plus compact and gentium basic (for bold). The bug seems to affect all of them. Perhaps it has to do with a conflict in the font names hidden in the cruft somewhere. I've looked in the xml file, but there's just pages of gumph...
Sujato
Offline
Last seen: 4 years 9 weeks ago
Title:
Joined: 27 Mar 2012
Posts: 5
problem reported with gentium elsewhere

I just noticed a post over on the OpenOffice forums that seems to refer to the same bug, specifically with Gentium. There's no response to this problem there:

http://www.oooforum.org/forum/viewtopic.phtml?t=101685

I'll try contacting the Gentium people....

Sujato
Offline
Last seen: 4 years 9 weeks ago
Title:
Joined: 27 Mar 2012
Posts: 5
problem possibly identified with Graphite

I've come across this lengthy post discussing what may be a related issue. 

https://issues.apache.org/ooo/show_bug.cgi?id=111054

It seems the problem may lie with the Graphite rendering engine that is used with Gentium and other fonts produced by SIL. 

I have been able to reproduce the bug with SIL's Charis font, so it does seem likely that it is a Graphite issue, rather than Gentium.

The thread has a patch. The discussion gets way too technical for me, but fortunately I live with someone of much better IT skills so we'll try and see.

oweng
oweng's picture
Offline
Last seen: 5 days 10 hours ago
Title: ==Moderator==
Joined: 26 Jan 2012
Posts: 3281
sounds like a bug in LO

I saw one of those threads last night, but from reading the Apache OO thread I would say it may be a bug in the Graphite rendering engine of LO. It is also suggested in that thread that character spacing might be a related cause, but I (again) cannot reproduce the problem here by setting the character spacing to Expanded 0.5pt.

I will follow this up further later today. For completeness this other thread from this forum provides further information about Graphite and related FOSS fonts.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.