You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Burkhardt Renz <Bu...@compuserve.com> on 2000/02/03 19:17:13 UTC

Testing fop 3

Testing fop

Hi,
I found the follwing problem while using and discovering fop
I hope with this report I can help to improve fop.

BurkhardtRenz@compuserve.com

Problem Report 3

Subject:
wrap-option and white-space-treatment

Problem:
In a block with wrap-option="no" and white-space-treatment="preserve" a
newline character
leads to a leading space on the following line.
I would expect, that the newline has no effect on the follwing line.

Work around:
Calculate the indent of block with respect to this leading space.
Certainly this work around does not help if one wants no indentation of the
block.

Analysis:
fop.layout.linearea.java. Line 243-253 
There seems to be a bug:
Could it be that one should treat in case (c == '\n') 
the values WhiteSpaceTreatment.IGNORE and WhiteSpaceTreatment.PRESERVE
alternatively?

Example:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin-right="4.5cm" margin-left="3cm"
margin-bottom="2.5cm" margin-top="3cm" width="21cm" height="29.7cm"
page-master-name="first">
<fo:region-body margin-top="28pt"/>
</fo:simple-page-master>
<fo:simple-page-master margin-right="4.5cm" margin-left="3cm"
margin-bottom="2.5cm" margin-top="3cm" width="21cm" height="29.7cm"
page-master-name="rest">
<fo:region-body margin-top="28pt"/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence>
<fo:sequence-specification>
<fo:sequence-specifier-repeating page-master-repeating="rest"
page-master-first="first"/>
</fo:sequence-specification>
<fo:flow flow-name="xsl-body">
<fo:block white-space-treatment="preserve" wrap-option="no-wrap"
text-align="start" line-height="12pt" font-family="monospace"
font-weight="normal" font-style="normal" font-size="10pt">Line with
wrap-option="no-wrap" and white-space-treatment="preserve"
SecondLine
<fo:block white-space-treatment="preserve" wrap-option="no-wrap"
text-align="start" line-height="12pt" font-family="monospace"
font-weight="normal" font-style="normal" font-size="10pt">
Line with wrap-option="no-wrap" and white-space-treatment="preserve"
SecondLine
</fo:block>
</fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>