layout constraint violations (was Re: Commit: More section break goodness.)


Subject: layout constraint violations (was Re: Commit: More section break goodness.)
From: Paul Rohr (paul@abisource.com)
Date: Fri Aug 10 2001 - 16:09:38 CDT


At 03:09 PM 8/10/01 -0400, Leonard Rosenthol wrote:
>At 08:58 PM 8/10/2001 +0200, Hubert Figuiere wrote:
>>According to Jesper Skov <jskov@redhat.com>:
>> > This cannot be (easily) fixed. I asked a long time back how to cope
>> > with for example a tab indent which is bigger than the page
>> > width. This is what this assertion is about: there is not enough
>> > (horizontal) space on the page to layout the Run.
>>
>>Why not simply wrapping the line in this case too, and ignore tabs
>>outside the page bounds. This is what other WP do.
>
> What Hub said!! If you have a run that exceeds the width, you
>wrap it - even if it means wrapping in the middle of a long string (ie. a
>URL).
>
> Interesingly, I just had to deal with this in my layout engine
>this week when I implemented columns and tried to render some text with a
>long URL that wouldn't fit in the column width. I just wrapped it at the
>column width and continued on the next line!

Definitely. I'm with Hub on this too. :-)

If we want a more general approach, it helps to note that there are two
possible kinds of constraint violations here:

  - hard ... content would flow off physical page
  - soft ... content wider than logical container

I can think of at least four sources of these flow violations:

  - content too big
      - images
      - very long unbroken "words"
      - etc.

  - container too small
      - tabstops out of bounds
      - very narrow margins
      - etc.

In principle, I'd recommend that we try as hard to find sensible ways to
prevent hard violations, but go ahead and allow soft violations where it
increases the usability to do so.

Thus, in the case of tabs, we should clearly prevent "hard" violations by
simply ignoring any tabstops that are off the page entirely. However, I
don't mind honoring "soft" violations for tabstops, so long as we give
enough GUI feedback to help people figure out when they're shooting
themselves in the foot. (Overlapping or truncated text, for example.)

In the case of text, I thought we already had logic to force breaks
inside words -- hyphenation or no hyphenation -- to get them to fit. (In
other words, in this case even soft violations don't make sense.)

Anyone want to work through the other screw cases and propose solutions?
The goal would be to come up with something that most users of other word
processors wouldn't find confusing or unexpected.

Paul



This archive was generated by hypermail 2b25 : Fri Aug 10 2001 - 16:02:14 CDT