You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by John Escott <JR...@scanlaser.nl> on 2009/03/04 00:40:12 UTC

block margin as a percentage 0.95 / 0.93 difference

Hi,

I'm having a problem setting a block margin-right to a percentage if the 
block is the first child of its containing block and this containing block 
is within a block-container. The effect is as though the right-margin is 
0. (Using fop 0.95 with pdf output)

For instance, in
        <fo:block-container height="40mm">
                <fo:block id="1" border="0.4pt solid black">
                        <fo:block id="2" margin-right="40%" 
text-align="right">bad</fo:block>
                        <fo:block id="3">some text</fo:block>
                        <fo:block id="4" margin-right="40%" 
text-align="right">good</fo:block>
                </fo:block>
        </fo:block-container>
"bad" is right-aligned at the right-hand side of block 1 but "good" is 
positioned near the middle of the block (40% from the right).

If I run it with fop-0.93, then they're both aligned in the "good" 
position.

I guess this is a bug in 0.95? or is my understanding of block-container 
at fault?
Anyone care to comment?

best regards, John Escott.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by Andreas Delmelle <an...@telenet.be>.
On 04 Mar 2009, at 21:26, Jeremias Maerki wrote:

> On 04.03.2009 20:26:29 Andreas Delmelle wrote:
>> OK, in the meantime I've found out that the native FO property (end-
>> indent) does work properly. It seems to an error in the corresponding
>> property mapping. I'll look into it further.
>
> No, that's not it. Set a break point in
> AbstractBaseLayoutManager.getAncestorBlockAreaIPD(). The first child
> layout manager of the block[@id=1] (i.e. block[@id=2]) is  
> initialize()d
> before block[@id=1] knows its own IPD (due to break-before processing
> within the block-container.

Ah, OK, then the behavior almost seems to be compliant. :-)
Percentages on margin-* are defined in terms of the "containing  
block", but for the native FO properties, this is done in terms of the  
"containing reference-area"...

Hence why end-indent does produce the intended effect, since it does  
not enter the cited method.


Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 04.03.2009 20:26:29 Andreas Delmelle wrote:
> 
> On 04 Mar 2009, at 20:13, Andreas Delmelle wrote:
> 
> > On 04 Mar 2009, at 19:54, Andreas Delmelle wrote:
> >
> >> No immediate idea on whether it would be difficult to correct, so  
> >> that it works the same as in 0.93. If my above assumption is  
> >> correct, an immediate workaround may be to specify the inline- 
> >> progression-dimension on the block-container (if possible).
> >
> > Sorry, should've checked this. Just did and this doesn't work  
> > either...
> 
> OK, in the meantime I've found out that the native FO property (end- 
> indent) does work properly. It seems to an error in the corresponding  
> property mapping. I'll look into it further.

No, that's not it. Set a break point in
AbstractBaseLayoutManager.getAncestorBlockAreaIPD(). The first child
layout manager of the block[@id=1] (i.e. block[@id=2]) is initialize()d
before block[@id=1] knows its own IPD (due to break-before processing
within the block-container.

> In the meantime, use end-indent instead of margin-right, and you  
> should be fine.
> 
> 
> HTH!
> 
> Andreas



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by Andreas Delmelle <an...@telenet.be>.
On 04 Mar 2009, at 20:13, Andreas Delmelle wrote:

> On 04 Mar 2009, at 19:54, Andreas Delmelle wrote:
>
>> No immediate idea on whether it would be difficult to correct, so  
>> that it works the same as in 0.93. If my above assumption is  
>> correct, an immediate workaround may be to specify the inline- 
>> progression-dimension on the block-container (if possible).
>
> Sorry, should've checked this. Just did and this doesn't work  
> either...

OK, in the meantime I've found out that the native FO property (end- 
indent) does work properly. It seems to an error in the corresponding  
property mapping. I'll look into it further.

In the meantime, use end-indent instead of margin-right, and you  
should be fine.


HTH!

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by Andreas Delmelle <an...@telenet.be>.
On 04 Mar 2009, at 19:54, Andreas Delmelle wrote:

> No immediate idea on whether it would be difficult to correct, so  
> that it works the same as in 0.93. If my above assumption is  
> correct, an immediate workaround may be to specify the inline- 
> progression-dimension on the block-container (if possible).

Sorry, should've checked this. Just did and this doesn't work either...


Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by Andreas Delmelle <an...@telenet.be>.
On 04 Mar 2009, at 12:13, Vincent Hennebert wrote:

Hi

> John Escott wrote:
>> Hi,
>>
>> I'm having a problem setting a block margin-right to a percentage  
>> if the
>> block is the first child of its containing block and this  
>> containing block
>> is within a block-container. The effect is as though the right- 
>> margin is
>> 0. (Using fop 0.95 with pdf output)
> <snip />
> This indeed sounds like a bug. Would you mind creating a bug report on
> Bugzilla, and attach a small FO file showing the error?
> https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop

FWIW, it seems to be a rather special case...

The block-container has "auto" ipd (determined by the content), so I'm  
assuming that at the point the block[@id='2'] is processed, the  
percentage is resolved as "40% of zero". After this block, the block- 
container's ipd will be updated, so for following blocks there is no  
problem (although we could get weird-looking fluctuations in case more  
and wider blocks are added)

No immediate idea on whether it would be difficult to correct, so that  
it works the same as in 0.93. If my above assumption is correct, an  
immediate workaround may be to specify the inline-progression- 
dimension on the block-container (if possible).


Cheers

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi John,

This indeed sounds like a bug. Would you mind creating a bug report on
Bugzilla, and attach a small FO file showing the error?
https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop

Thanks!
Vincent


John Escott wrote:
> Hi,
> 
> I'm having a problem setting a block margin-right to a percentage if the 
> block is the first child of its containing block and this containing block 
> is within a block-container. The effect is as though the right-margin is 
> 0. (Using fop 0.95 with pdf output)
> 
> For instance, in
>         <fo:block-container height="40mm">
>                 <fo:block id="1" border="0.4pt solid black">
>                         <fo:block id="2" margin-right="40%" 
> text-align="right">bad</fo:block>
>                         <fo:block id="3">some text</fo:block>
>                         <fo:block id="4" margin-right="40%" 
> text-align="right">good</fo:block>
>                 </fo:block>
>         </fo:block-container>
> "bad" is right-aligned at the right-hand side of block 1 but "good" is 
> positioned near the middle of the block (40% from the right).
> 
> If I run it with fop-0.93, then they're both aligned in the "good" 
> position.
> 
> I guess this is a bug in 0.95? or is my understanding of block-container 
> at fault?
> Anyone care to comment?
> 
> best regards, John Escott.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: block margin as a percentage 0.95 / 0.93 difference

Posted by John Escott <jr...@scanlaser.nl>.
I've entered this in bugzilla as bug 46813
-- 
View this message in context: http://www.nabble.com/block-margin-as-a-percentage-0.95---0.93-difference-tp22320616p22369497.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org