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 Manuel Mall <mm...@arcus.com.au> on 2006/02/14 07:24:03 UTC

Re: differnece between fop and xep: which is right?

Jeremias,

I did read those sections of the spec at the time and that's how the
question arose. I didn't check the code though. Any way the spec says in
7.28.4:

body-start() = the value of the start-indent + start-intrusion-adjustment
+ the value of the provisional-distance-between-starts of the closest
ancestor fo:list-block.

The questions arises what is meant by 'the value of the start-indent',
i.e. the start-indent of which fo is suppose to be used? Does the suffix
'of the closest ancestor fo:list-block' apply to all three terms
'start-indent', 'start-intrusion-adjustment' and
'provisional-distance-between-starts' or only to
'provisional-distance-between-starts'?.

I assume now it means the further that is start-indent is to be taken from
the closest ancestor fo:list-block. Therefore my initial concern that we
have a recursive case here is probably not an issue.

Now (finally) looking at the code it navigates up the fo tree until the
nearest ancestor fo:list-item and not fo:list-block. If start-indent on a
fo:list-item is always identical to the start-indent on the ancestor
list-block thats fine. If its not then we may have a problem.

Manuel

PS: Moved the thread to fop-dev.

> Manuel,
>
> see 7.28.4. “provisional-distance-between-starts” and 5.10.4. "Property
> Value
> Functions"
>
> In the source code: org.apache.fop.fo.expr.BodyStartFunction
>
> On 13.02.2006 09:31:47 Manuel Mall wrote:
>> Jeremias,
>>
>> just out of curiosity and not directly related to the posters question:
>>
>> The definition of block-start() refers to start-indent. Here we are
>> actually setting start-indent. Which value of start-indent is used in
>> calculating block-start()?
>>
>> Manuel
>>
>> > I think XEP is wrong if it reports an error. XSL-FO 1.0 says in "5.9
>> > Expressions": "All property value specifications in attributes within
>> an
>> > XSL stylesheet can be expressions."
>> >
>> > IMO, your expression for start-indent is valid.
>> >
>> > On 13.02.2006 04:59:48 Paul Tremblay wrote:
>> >> I have the following line in my of.xml file:
>> >>
>> >>
>> >>     <fo:list-item space-before="12pt">
>> >>     	<fo:list-item-label end-indent="label-end()">
>> >> 		<fo:block></fo:block>
>> >> 	</fo:list-item-label>
>> >> 	<fo:list-item-body start-indent="body-start() + 12pt"
>> >> 	text-indent="-12pt">
>> >> 	   <fo:block>In late
>> >> winter</fo:block></fo:list-item-body></fo:list-item>
>> >>
>> >> I want to create a hanging indents for long lines of poetry. When I
>> >> run this document through xep's processor, I get the following error:
>> >>
>> >>  [warning] Bad attribute start-indent: Cannot add type Word to type
>> >>  Length
>> >>
>> >> However, when I run it through fop .91 beta, it works exactly like I
>> >> want it to.
>> >>
>> >> Is xep correct in reporting an error? Is fop cheating? Of course, I
>> am
>> >> glad that fop processes the document the way I want!
>> >
>> >
>> > Jeremias Maerki
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



Re: difference between fop and xep: which is right?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I made some tests and still think my/FOP's interpretation is correct. I
wonder why the start-indent and end-indent properties on list-item
should be ignored/overhopped by label-end/body-start if they are
explicitely listed as properties applicable to list-item. I've attached
a test file which renders (what a surprise) differently in FOP Trunk,
AltSoft 2.2.1 and XEP 4.4. Someone please tell me which is right. Grmbl.
I hate the FO spec!


On 14.02.2006 22:13:42 Simon Pepping wrote:
> I read the two definitions in 7.28,3 and 7.28.4 as follows:
> 
> label-end() =
>   width of the content-rectangle of the reference-area into
>     which the list-block is placed
>    - (the value of the provisional-distance-between-starts
>       + the value of the start-indent
>       + start-intrusion-adjustment
>       - the value of the provisional-label-separation)
>      of the closest ancestor fo:list-block
> 
> (that is, as printed in the spec) and
> 
> body-start() =
>   (the value of the start-indent
>    + start-intrusion-adjustment
>    + the value of the provisional-distance-between-starts)
>   of the closest ancestor fo:list-block
> 
> (that is, I added parentheses around the expression so that all are
> evaluated on fo:list-block).
> 
> Then you can do some math:
> 
> label-end() =
>   width of the content-rectangle of the reference-area into
>     which the list-block is placed
>    - (body-start()
>       - the value of the provisional-label-separation)
>      of the closest ancestor fo:list-block
> 
> which gives:
> 
> width of the content-rectangle - label-end()
>   + provisional-label-separation = body-start()
> 
> label-end() is counted from the end of the content-rectangle, and
> therefore width of the content-rectangle - label-end() is the distance
> of the label end to the start of the content-rectangle. Then
> 
> from start of content-rectangle to end of label
>   + provisional-label-separation = body-start()
> 
>   +-----------------------------------------------------+
>   |                                                     |
>   |   +-------+   +-------------------------------+     |
>   |   |       |   |                               |     |
>   |   +-------+   |                               |     |
>   |           .   |                               |     |
>   |           .   |                               |     |
>   |           .   |                                     |
>   |           .<--------------------------------------->|
>               .   |       label-end()                   |
>    <------------->|
>      body-start() |
>    <--------->.<->|
>         (1)   .(2)|
> 
>  (1) = width of the content-rectangle - label-end()
>  (2) = provisional-label-separation
>  (1) + (2) = body-start()
> 
> This is the relation you would expect, which supports my
> interpretation.
> 
> Sorry for still being at the level of ascii art. Read it in Courier.
> 
> Simon
> 
> On Tue, Feb 14, 2006 at 09:36:06AM +0100, Jeremias Maerki wrote:
> >
> > On 14.02.2006 07:24:03 Manuel Mall wrote:
> > > Jeremias,
> > >
> > > I did read those sections of the spec at the time and that's how the
> > > question arose. I didn't check the code though. Any way the spec says in
> > > 7.28.4:
> > >
> > > body-start() = the value of the start-indent + start-intrusion-adjustment
> > > + the value of the provisional-distance-between-starts of the closest
> > > ancestor fo:list-block.
> > >
> > > The questions arises what is meant by 'the value of the start-indent',
> > > i.e. the start-indent of which fo is suppose to be used? Does the suffix
> > > 'of the closest ancestor fo:list-block' apply to all three terms
> > > 'start-indent', 'start-intrusion-adjustment' and
> > > 'provisional-distance-between-starts' or only to
> > > 'provisional-distance-between-starts'?.
> >
> > "start-indent" can't be the start-indent of the list-item-body, that
> > much is clear. I always assumed it was inherited(start-indent). Anything
> > else would make no sense (recursion). I guess the spec could be clearer.
> > "of the closest anscestor fo:list-block" (at least for me) applies
> > directly and only to "provisional-distance-between-starts". That
> > property is inherited but only applies to fo:list-block. Furthermore,
> > start-intrusion-adjustment is something that can't come from the
> > list-block.
> >
> > > I assume now it means the further that is start-indent is to be taken from
> > > the closest ancestor fo:list-block. Therefore my initial concern that we
> > > have a recursive case here is probably not an issue.
> >
> > As I wrote above, I believe it's inherited(start-indent), i.e. comes
> > from the parent fo:list-item, not the list-block. This is important
> > because it allows you to indent individual list-items differently in the
> > same list-block.
> 
> --
> Simon Pepping
> home page: http://www.leverkruid.nl



Jeremias Maerki

Re: differnece between fop and xep: which is right?

Posted by Simon Pepping <sp...@leverkruid.nl>.
I read the two definitions in 7.28,3 and 7.28.4 as follows:

label-end() =
  width of the content-rectangle of the reference-area into
    which the list-block is placed
   - (the value of the provisional-distance-between-starts
      + the value of the start-indent
      + start-intrusion-adjustment
      - the value of the provisional-label-separation)
     of the closest ancestor fo:list-block

(that is, as printed in the spec) and

body-start() =
  (the value of the start-indent
   + start-intrusion-adjustment
   + the value of the provisional-distance-between-starts)
  of the closest ancestor fo:list-block

(that is, I added parentheses around the expression so that all are
evaluated on fo:list-block).

Then you can do some math:

label-end() =
  width of the content-rectangle of the reference-area into
    which the list-block is placed
   - (body-start()
      - the value of the provisional-label-separation)
     of the closest ancestor fo:list-block

which gives:

width of the content-rectangle - label-end()
  + provisional-label-separation = body-start()

label-end() is counted from the end of the content-rectangle, and
therefore width of the content-rectangle - label-end() is the distance
of the label end to the start of the content-rectangle. Then

from start of content-rectangle to end of label
  + provisional-label-separation = body-start()

  +-----------------------------------------------------+
  |                                                     |
  |   +-------+   +-------------------------------+     |
  |   |       |   |                               |     |
  |   +-------+   |                               |     |
  |           .   |                               |     |
  |           .   |                               |     |
  |           .   |                                     |
  |           .<--------------------------------------->|
              .   |       label-end()                   |
   <------------->|
     body-start() |
   <--------->.<->|
        (1)   .(2)|

 (1) = width of the content-rectangle - label-end()
 (2) = provisional-label-separation
 (1) + (2) = body-start()

This is the relation you would expect, which supports my
interpretation.

Sorry for still being at the level of ascii art. Read it in Courier.

Simon

On Tue, Feb 14, 2006 at 09:36:06AM +0100, Jeremias Maerki wrote:
>
> On 14.02.2006 07:24:03 Manuel Mall wrote:
> > Jeremias,
> >
> > I did read those sections of the spec at the time and that's how the
> > question arose. I didn't check the code though. Any way the spec says in
> > 7.28.4:
> >
> > body-start() = the value of the start-indent + start-intrusion-adjustment
> > + the value of the provisional-distance-between-starts of the closest
> > ancestor fo:list-block.
> >
> > The questions arises what is meant by 'the value of the start-indent',
> > i.e. the start-indent of which fo is suppose to be used? Does the suffix
> > 'of the closest ancestor fo:list-block' apply to all three terms
> > 'start-indent', 'start-intrusion-adjustment' and
> > 'provisional-distance-between-starts' or only to
> > 'provisional-distance-between-starts'?.
>
> "start-indent" can't be the start-indent of the list-item-body, that
> much is clear. I always assumed it was inherited(start-indent). Anything
> else would make no sense (recursion). I guess the spec could be clearer.
> "of the closest anscestor fo:list-block" (at least for me) applies
> directly and only to "provisional-distance-between-starts". That
> property is inherited but only applies to fo:list-block. Furthermore,
> start-intrusion-adjustment is something that can't come from the
> list-block.
>
> > I assume now it means the further that is start-indent is to be taken from
> > the closest ancestor fo:list-block. Therefore my initial concern that we
> > have a recursive case here is probably not an issue.
>
> As I wrote above, I believe it's inherited(start-indent), i.e. comes
> from the parent fo:list-item, not the list-block. This is important
> because it allows you to indent individual list-items differently in the
> same list-block.

--
Simon Pepping
home page: http://www.leverkruid.nl


Re: differnece between fop and xep: which is right?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 14.02.2006 07:24:03 Manuel Mall wrote:
> Jeremias,
> 
> I did read those sections of the spec at the time and that's how the
> question arose. I didn't check the code though. Any way the spec says in
> 7.28.4:
> 
> body-start() = the value of the start-indent + start-intrusion-adjustment
> + the value of the provisional-distance-between-starts of the closest
> ancestor fo:list-block.
> 
> The questions arises what is meant by 'the value of the start-indent',
> i.e. the start-indent of which fo is suppose to be used? Does the suffix
> 'of the closest ancestor fo:list-block' apply to all three terms
> 'start-indent', 'start-intrusion-adjustment' and
> 'provisional-distance-between-starts' or only to
> 'provisional-distance-between-starts'?.

"start-indent" can't be the start-indent of the list-item-body, that
much is clear. I always assumed it was inherited(start-indent). Anything
else would make no sense (recursion). I guess the spec could be clearer.
"of the closest anscestor fo:list-block" (at least for me) applies
directly and only to "provisional-distance-between-starts". That
property is inherited but only applies to fo:list-block. Furthermore,
start-intrusion-adjustment is something that can't come from the
list-block.

> I assume now it means the further that is start-indent is to be taken from
> the closest ancestor fo:list-block. Therefore my initial concern that we
> have a recursive case here is probably not an issue.

As I wrote above, I believe it's inherited(start-indent), i.e. comes
from the parent fo:list-item, not the list-block. This is important
because it allows you to indent individual list-items differently in the
same list-block.

> Now (finally) looking at the code it navigates up the fo tree until the
> nearest ancestor fo:list-item and not fo:list-block. If start-indent on a
> fo:list-item is always identical to the start-indent on the ancestor
> list-block thats fine. If its not then we may have a problem.

I don't think we have a problem. I believe the code is correct. What we
could do, however, is add additional test cases which exercise the
different start-indent scenarios. That would also allow comparisons with
other implementations.

> Manuel
> 
> PS: Moved the thread to fop-dev.
> 
> > Manuel,
> >
> > see 7.28.4. “provisional-distance-between-starts” and 5.10.4. "Property
> > Value
> > Functions"
> >
> > In the source code: org.apache.fop.fo.expr.BodyStartFunction
> >
> > On 13.02.2006 09:31:47 Manuel Mall wrote:
> >> Jeremias,
> >>
> >> just out of curiosity and not directly related to the posters question:
> >>
> >> The definition of block-start() refers to start-indent. Here we are
> >> actually setting start-indent. Which value of start-indent is used in
> >> calculating block-start()?
> >>
> >> Manuel
> >>
> >> > I think XEP is wrong if it reports an error. XSL-FO 1.0 says in "5.9
> >> > Expressions": "All property value specifications in attributes within
> >> an
> >> > XSL stylesheet can be expressions."
> >> >
> >> > IMO, your expression for start-indent is valid.
> >> >
> >> > On 13.02.2006 04:59:48 Paul Tremblay wrote:
> >> >> I have the following line in my of.xml file:
> >> >>
> >> >>
> >> >>     <fo:list-item space-before="12pt">
> >> >>     	<fo:list-item-label end-indent="label-end()">
> >> >> 		<fo:block></fo:block>
> >> >> 	</fo:list-item-label>
> >> >> 	<fo:list-item-body start-indent="body-start() + 12pt"
> >> >> 	text-indent="-12pt">
> >> >> 	   <fo:block>In late
> >> >> winter</fo:block></fo:list-item-body></fo:list-item>
> >> >>
> >> >> I want to create a hanging indents for long lines of poetry. When I
> >> >> run this document through xep's processor, I get the following error:
> >> >>
> >> >>  [warning] Bad attribute start-indent: Cannot add type Word to type
> >> >>  Length
> >> >>
> >> >> However, when I run it through fop .91 beta, it works exactly like I
> >> >> want it to.
> >> >>
> >> >> Is xep correct in reporting an error? Is fop cheating? Of course, I
> >> am
> >> >> glad that fop processes the document the way I want!


Jeremias Maerki