[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Confusing textwrap parameters, and request for RE help

On 2020-03-26, Peter J. Holzer <hjp-python at> wrote:
>> Actually, fixed width fonts are easy to justify, you just add additional 
>> space between words through the line.
> Yes. It's easy to do it wrong and impossible to do it right :-)
> (BTDT)
> The problem is that you can only insert an integral number of spaces und
> the number of spaces you need to insert is rarely a multiple of the
> number of gaps between words. So you get uneven spacing, which looks
> horrible.

That was always an interesting freshman programming homework
problem. But you're right, nobody in their right mind would actually
want to generate real output that way.  Ragged-right is far, far
better than using fixed-width font justified with extra spaces
scattered in.