https://issues.apache.org/bugzilla/show_bug.cgi?id=45097





--- Comment #7 from Andreas L. Delmelle <[EMAIL PROTECTED]>  2008-05-29 
12:26:22 PST ---
(In reply to comment #5)
> 
> Sorry, I probably wasn't very clear. White-space-preserve is set on both
> Example 1 and Example 4.  The behavior of Example 1 was expected but the
> behavior of Example 4 was *not* expected...at first.  The preservation of the
> space after each formatter-generated line feed looks funny and I thought it 
> was
> a bug.  But after thinking about it and reading the white-space handling
> portion of the specification I began to see why it's being done...after all, 
> we
> are saying to preserve all white space and I saw no mention in the spec that
> formatter-generated line feeds should replace surrounding space characters.  
> So
> I removed white-space-preserve to make Example 4 look like Example 5 (what I
> want), but of course that made Example 1 look like Example 3 (what I didn't
> want).

Yep, either you preserve white-space surrounding linefeeds or you don't.

Note that white-space-treatment (in XSL-FO 1.1 at least) is defined in terms of
preserving/discarding glyph-areas for XML white-space characters during
line-building. So the preservation is not restricted to spaces surrounding
explicit linefeed-characters.

> Technically this "worked" in FOP 0.20.5, but that's not saying much since it
> had other problems related to white-space handling.  Basically, I don't see
> anyone wanting the behavior shown in Example 4 (unless they actually put in a
> text-indent), so I'm questioning if it's truly working as expected.

The fact that Example 4 only has preserved spaces at the start of the lines is
because all the line-breaks are implicit, and if the line-breaking algorithm
has a choice of either breaking before or after a space, it will always break
before it. The result is therefore correct, even though the chances of anyone
seeking that behavior are very slim. Trailing spaces on a line will normally
only appear in case there are also explicit linefeeds or nested blocks, like:

<fo:block white-space-treatment="preserve">
  <fo:block linefeed-treatment="preserve">text   &#x0A;   text</fo:block>
  <fo:block>text   <fo:block />   text</fo:block>
</fo:block>

> To explain a little about what I'm doing, I'm wrapping user-entered text in a
> block, and I want to ensure I keep their formatting.  But I appear to be in a
> catch-22 because if I do that then I also get this "handing indent" problem 
> for
> blocks that have more than 1 line area.

Actually, it seems like you want to do more than just 'keep the original
formatting'. This scenario is very different from the case where one would use
preserved linefeeds combined with wrap-option="no-wrap". It seems like you need
a mixture of both, since you do seem to be needing formatter-generated
linebreaks as well.
Example 1 is also slightly different than Example 5, since it contains nested
blocks. Moving white-space-treatment="preserve" to the inner blocks may be an
option, but I don't know if that fits in your processing logic (?)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to