[Scribus] word wrap error

Craig Ringer craig
Mon May 2 06:38:14 CEST 2005

On Sun, 2005-05-01 at 17:38 -0400, Gregory Pittman wrote:
> Craig Bradney wrote:
> >Try a search and replace before or after your import for "  " with " ". 
> >Whether or not there is an issue on wrapping, you dont want them in the 
> >middle of your lines either.
> >  
> >
> I've thought about this, but if that's the recommendation, then really 
> everyone should do this on every text file, in which case maybe it 
> should be a built-in process on text frame import.

Perhaps so. You can actually do it with text import reasonably easily
as-is ; just use a regular expression like (perl syntax):

s/[ ]+/ /g

with the Get Text dialog, by selecting the "Text filters" importer.  Use
"Replace" and tick the little checkbox that says "value at the left is a
regular expression", then enter [ ]+ into the left box and a single
space into the right box.  The regex system supports most of Perl's
regular expression syntax so you can use things like [ ]{1,3} to match
one to three spaces, for example.  QRegEx in the Qt documentation has
the full spill in case you care.

It's not hard to extend that to do things like strip double spaces only
after periods (full stops).

Thanks Riku for adding that regex support.

> A final thought: fully-justified text should have a space at the end of 
> a line or the beginning of the next, if it works analogously to the 
> left-justified algorithm as it exists.

Personally, I think spaces at the end of the line / beginning of the
next should be collapsed, ie not shown, *unless* it is a non-breaking
space. I thought there was a bug on this - it's certainly in my notes

The same should probably be true of other text alignment. A space is for
separating text; if there's no text to separate, there's no point in
retaining the space IMO. In particular, left-justified text should be
able to touch both sides of the frame _without_ pushing a trailing space
to the beginning of the next line.

These are just my relatively unconsidered views, though. We really
shouldn't be re-inventing the wheel more than we have to - so when in
doubt, "how does TeX do it?".

Craig Ringer

More information about the scribus mailing list