Hi Jeremias,

Thank you for your answer.

Standard is strange, indeed, at least for someone who got used to HTML CSS, but I will stick to it.

If I understand correctly, start-indent on block-container is calculated as margin + border + padding = 0 + 0.2 + 0 = 0.2 cm. Then, it is inherited for the block, and added to margin + border + padding of the block, so relative position of the text to the border of the block-container is 0.2 + 0 + 0.4 + 0 = 0.6 cm. In order to change inherited indent I may override start- and end-indent to be equal to border width of of the block (0.4 cm), or define left and right margin as "-0.2cm", which both works:

1:
<block-container text-align="left" border="0.2cm solid black"
                 width="20cm" padding="0" margin="0">
  <block padding="0" border="0.4cm solid red"
         start-indent="0.4cm" end-indent="0.4cm">
    test text test
  </block>
</block-container>

2:
<block-container text-align="left" border="0.2cm solid black"
                 width="20cm" padding="0" margin="0">
  <block padding="0" border="0.4cm solid red"
         margin-left="-0.2cm" margin-right="-0.2cm">
    test text test
  </block>
</block-container>

Other than that, I also tried to enclose the content of the block container in new block:

3:
<block-container text-align="left" border="0.2cm solid black"
                 width="20cm" padding="0" margin="0">
  <block start-indent="0" end-indent="0">
    <block padding="0" border="0.4cm solid red" >
      test text test
    </block>
  </block>
</block-container>

But that does not work, since borders overlaps.

Regards,
Ognjen


On 30.8.2010 16:16, Jeremias Maerki wrote:
You're seeing the effect of "indent inheritance":
http://wiki.apache.org/xmlgraphics-fop/IndentInheritance

Yes, FOP's behaviour is correct with respect to the specification. Yes,
it's unexpected.

You have two options:

1. Enclose the contents of the block-container with an fo:block where
you set start-indent="0cm" and end-indent="0cm".

2. Enabled the "break-indent-inheritance" configuration option.
http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements

On 30.08.2010 14:05:51 Ognjen Blagojevic wrote:
Hi,

I have very simple example where I nest block inside block-container. I
set both paddings and margins to 0. I am confused since unexplained
padding (left and right) appears inside block-container.

I would expect that borders are one next to another but this is not the
case. Top and bottom borders are, but left and right are not.

Am I missing something really obvious?

Tested with fop 0.95 and 1.0, Windows XP SP3, Java 1.6.

Full example below:

=====
<?xml version="1.0" encoding="utf-8"?>
<root xmlns="http://www.w3.org/1999/XSL/Format";>

<layout-master-set>
    <simple-page-master master-name="first" page-height="29.7cm"
page-width="21cm" margin="2.5cm">
      <region-body></region-body>
    </simple-page-master>
</layout-master-set>

   <page-sequence master-reference="first">
     <flow flow-name="xsl-region-body">

       <block-container text-align="left" border="0.2cm solid black"
           width="10cm" padding="0" margin="0">

         <block padding="0" margin="0" border="0.4cm solid red">
           test text test text test text test text test text test
           test text test text test text test text test text test
           test text test text test text test text test text test
         </block>

       </block-container>

     </flow>
   </page-sequence>
</root>
-----


Regards,
Ognjen



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to