Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Luca Furini

Chris Bowditch wrote:


+  * Conditional space support, i.e. space-before.conditionality=retain


Chris, doesn't this work already?

As far as I can remember the correct space resolution is still missing, so 
for example the space-after of a block is not added to the space-after 
of the following block (they are just appended, and this has some side 
effects on keeps), but the conditionality should be handled correctly.


I have just tested the simplest example possible (just a block with text 
and a space-before with conditionality = retain) and it seems ok.


Regards
Luca




Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Jeremias Maerki
Well, there's exactly one test (space-block2) which looks at this and it
has no checks. As long as there are no tests with checks there is a
certain amount of uncertainty if a feature really works or not.

On 31.08.2005 10:52:07 Luca Furini wrote:
 Chris Bowditch wrote:
 
  +  * Conditional space support, i.e. space-before.conditionality=retain
 
 Chris, doesn't this work already?
 
 As far as I can remember the correct space resolution is still missing, so 
 for example the space-after of a block is not added to the space-after 
 of the following block (they are just appended, and this has some side 
 effects on keeps), but the conditionality should be handled correctly.
 
 I have just tested the simplest example possible (just a block with text 
 and a space-before with conditionality = retain) and it seems ok.
 
 Regards
  Luca
 



Jeremias Maerki



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Chris Bowditch

Luca Furini wrote:


Chris Bowditch wrote:


+  * Conditional space support, i.e. space-before.conditionality=retain



Chris, doesn't this work already?


Sorry that line wasn't clear enough. I just meant 
space-before.conditionality should be fully implemented = discard 
should work too.




As far as I can remember the correct space resolution is still missing, 
so for example the space-after of a block is not added to the 
space-after of the following block (they are just appended, and this has 
some side effects on keeps), but the conditionality should be handled 
correctly.


I have just tested the simplest example possible (just a block with text 
and a space-before with conditionality = retain) and it seems ok.


I just knocked up a small test case and although retain is honoured, 
discard is ignored. I knew it wasn't quite yet working but didn't 
realise retain was working :) I'll update the Wiki.


Chris



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Luca Furini

Chris Bowditch wrote:

I just knocked up a small test case and although retain is honoured, 
discard is ignored. I knew it wasn't quite yet working but didn't 
realise retain was working :) I'll update the Wiki.


Could you please also attach your file?

I have tested a simple sequence of blocks with conditional spaces and the 
output seems ok; the output of the testcase space-block2.xml seems correct 
too (I'm going to add checks).


Maybe I forgot to fix some LM.

Regards
Luca




Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Chris Bowditch

Luca Furini wrote:


Chris Bowditch wrote:

I just knocked up a small test case and although retain is honoured, 
discard is ignored. I knew it wasn't quite yet working but didn't 
realise retain was working :) I'll update the Wiki.



Could you please also attach your file?


Here is the sample:

fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
	fo:simple-page-master master-name=a4 page-width=210mm 
page-height=297mm margin=5mm
		fo:region-body margin-top=90mm margin-bottom=90mm 
background-color=blue/

/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=a4
fo:flow flow-name=xsl-region-body font-size=18pt
		fo:block space-before=5mm 
space-before.conditionality=retainThere should be 5mm of space before 
this block/fo:block
		fo:block space-before=5mm 
space-before.conditionality=discardThere should not be any space 
before this block

/fo:block
/fo:flow
/fo:page-sequence
/fo:root



I have tested a simple sequence of blocks with conditional spaces and 
the output seems ok; the output of the testcase space-block2.xml seems 
correct too (I'm going to add checks).


Not true, space-block2.xml does not work. On the second page, there 
should not be any space between the two paragraphs.


Chris



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Luca Furini

Chris Bowditch wrote:


Here is the sample:


Thanks!

I have tested a simple sequence of blocks with conditional spaces and 
the output seems ok; the output of the testcase space-block2.xml seems 
correct too (I'm going to add checks).


Not true, space-block2.xml does not work. On the second page, there 
should not be any space between the two paragraphs.


I'm no more sure I follow you ... :-)

In your example the second block has a conditional space before, but it is 
not the first son of a reference area (not the first in the page) so I 
would expect it not to be suppressed. Should all conditional spaces be 
always suppressed, regardless of their position, what whould be the point 
in using them? :-)


As per the testcase spaces-block2, I similarly think there should be a 
space between the first and second block on page 2; anyway, in this case 
the actual behaviour is probably wrong as the space resolution rules (if I 
understand them correctly) seems to imply that it should be only 10 
points.


Regards
Luca




Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Chris Bowditch

Luca Furini wrote:


Chris Bowditch wrote:


Here is the sample:



Thanks!

I have tested a simple sequence of blocks with conditional spaces and 
the output seems ok; the output of the testcase space-block2.xml 
seems correct too (I'm going to add checks).



Not true, space-block2.xml does not work. On the second page, there 
should not be any space between the two paragraphs.



I'm no more sure I follow you ... :-)


Well I'm not being clear enough again. Sorry.



In your example the second block has a conditional space before, but it 
is not the first son of a reference area (not the first in the page) so 
I would expect it not to be suppressed. Should all conditional spaces be 
always suppressed, regardless of their position, what whould be the 
point in using them? :-)


My sample is incomplete - it should have a space-after on first block. 
The purpose of discard working between two blocks that aren't first or 
last in the reference area is best explained with a use-case:


Imagine a scenario where you have many different documents generated by 
different stylesheets, which all share a common styleset, i.e. an 
imported XSL file containing xsl:attribute-sets. The styles defined 
there are used throughout the documents. Now in some documents you might 
have two adjacent paragraghs that both use styles with 
space-before=10pt and after=10pt.


In the document it is desirable only to have 10pt between the paragraphs 
but how this be achieved? The paragraphs need to use the styles they are 
using for other reasons. This is where discard comes in handy. Add 
conditionality=discard to the two styles and then the space from one 
gets dropped. The only other alternative is to re-engineer the common 
styleset which can affect many other documents. So whilst this may not 
seem important in a pure FO environment, the reason the XSL-FO WG added 
it to the spec was a convenience for such use cases.




As per the testcase spaces-block2, I similarly think there should be a 
space between the first and second block on page 2; anyway, in this case 
the actual behaviour is probably wrong as the space resolution rules (if 
I understand them correctly) seems to imply that it should be only 10 
points.


Yes, that's right there should be less space - not no space.

Chris



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Vincent Hennebert

Chris,

I'm afraid I don't agree with you here. You seem to mix up space conditionality 
and space precedence. See § 4.3 of the spec, and especially § 4.3.1, 
Space-resolution rules [1]
Conditionality only stands for spaces that begin a reference area; as per the 
first rule, all of the conditional spaces that begin a reference area are discarded.
Now for remaining spaces the precedence is to be considered. The space with the 
highest precedence wins.


In your sample (I have added a space-after for clarity):
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master master-name=a4 page-width=210mm 
page-height=297mm margin=5mm
fo:region-body margin-top=90mm margin-bottom=90mm 
background-color=blue/

/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=a4
fo:flow flow-name=xsl-region-body font-size=18pt
fo:block space-before=5mm space-before.conditionality=retain
  space-after=10mmThere should be 5mm of space before this 
block/fo:block
fo:block space-before=5mm 
space-before.conditionality=discardThere should be 10mm of space before this 
block

/fo:block
/fo:flow
/fo:page-sequence
/fo:root

The second fo:block does not begin a reference area, so space conditionality 
isn't taken into consideration. For both spaces, precedence is not specified so 
the default value of 0 is used (§ 7.10.5  7.10.6). The third rule of § 4.3.1 
states that between the two spaces of the same precedence, the one that has the 
highest (optimum) value wins; here the space-after of the first block.


Imagine a scenario where you have many different documents generated by 
different stylesheets, which all share a common styleset, i.e. an 
imported XSL file containing xsl:attribute-sets. The styles defined 
there are used throughout the documents. Now in some documents you might 
have two adjacent paragraghs that both use styles with 
space-before=10pt and after=10pt.


In the document it is desirable only to have 10pt between the paragraphs 
but how this be achieved? The paragraphs need to use the styles they are 
using for other reasons. This is where discard comes in handy. Add 
conditionality=discard to the two styles and then the space from one 
gets dropped.


Here we disagree: if I understand the spec correctly this is precedence that 
should be used, e.g. like in the following:
fo:block space-after=10mm space-after.precedence=100There should be 
10mm of space after this block/fo:block
fo:block space-before=10mm space-before.precedence=200There should be 
10mm of space before this block/fo:block


Here the space-before of the second block has a higher precedence than the 
space-after of the first one, and thus wins. The resolved space is 10mm.



 As per the testcase spaces-block2, I similarly think there should be a
 space between the first and second block on page 2; anyway, in this
 case the actual behaviour is probably wrong as the space resolution
 rules (if I understand them correctly) seems to imply that it should
 be only 10 points.


 Yes, that's right there should be less space - not no space.

I think Lucas is right here. The resolved space should be 10pt, that is the 
optimum space of the two spaces of same value and same precedence. If .minimum 
and .maximum were specified, the resolved space would take the minimum of the 
two .minimum values and the max of the two .maximum values for its own .min and 
.max values.


Do you agree?

Vincent


[1] http://www.w3.org/TR/xsl/slice4.html#area-space



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Chris Bowditch

Vincent Hennebert wrote:


Chris,

I'm afraid I don't agree with you here. You seem to mix up space 
conditionality and space precedence. See § 4.3 of the spec, and 
especially § 4.3.1, Space-resolution rules [1]
Conditionality only stands for spaces that begin a reference area; as 
per the first rule, all of the conditional spaces that begin a reference 
area are discarded.
Now for remaining spaces the precedence is to be considered. The space 
with the highest precedence wins.


It seems you are right. My purpose for adding an item to the plan was 
just to flag that this area needed further investigation. I am by no 
means an expert in the details of the spec. It seems that it is mostly 
working now but not 100%.


snip/

The second fo:block does not begin a reference area, so space 
conditionality isn't taken into consideration. For both spaces, 
precedence is not specified so the default value of 0 is used (§ 7.10.5 
 7.10.6). The third rule of § 4.3.1 states that between the two spaces 
of the same precedence, the one that has the highest (optimum) value 
wins; here the space-after of the first block.


Well the current implementation doesn't work like that. Both spaces are 
included to give 20pt of space between the two paragraphs.




Imagine a scenario where you have many different documents generated 
by different stylesheets, which all share a common styleset, i.e. an 
imported XSL file containing xsl:attribute-sets. The styles defined 
there are used throughout the documents. Now in some documents you 
might have two adjacent paragraghs that both use styles with 
space-before=10pt and after=10pt.


In the document it is desirable only to have 10pt between the 
paragraphs but how this be achieved? The paragraphs need to use the 
styles they are using for other reasons. This is where discard comes 
in handy. Add conditionality=discard to the two styles and then the 
space from one gets dropped.



Here we disagree: if I understand the spec correctly this is precedence 
that should be used, e.g. like in the following:
fo:block space-after=10mm space-after.precedence=100There 
should be 10mm of space after this block/fo:block
fo:block space-before=10mm space-before.precedence=200There 
should be 10mm of space before this block/fo:block


I'm not an expert in the details of the spec, but isnt the precendence 
ignored unless conditionality=discard?




Here the space-before of the second block has a higher precedence than 
the space-after of the first one, and thus wins. The resolved space is 
10mm.


The current code gives a 20mm space between the two, which is correct 
for retain but wrong for discard.





  As per the testcase spaces-block2, I similarly think there should be a
  space between the first and second block on page 2; anyway, in this
  case the actual behaviour is probably wrong as the space resolution
  rules (if I understand them correctly) seems to imply that it should
  be only 10 points.
 
 
  Yes, that's right there should be less space - not no space.

I think Lucas is right here. The resolved space should be 10pt, that is 
the optimum space of the two spaces of same value and same precedence. 
If .minimum and .maximum were specified, the resolved space would take 
the minimum of the two .minimum values and the max of the two .maximum 
values for its own .min and .max values.


Do you agree?


Yes I do agree, with the details you describe. But I wasn't trying to 
drill into detail, I was just saying it's not quite right yet. So my 
point still stands: there is some work still required to get this 
working 100%.


Chris



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Manuel Mall
Chris,

do you really think that FOray font integration is a prerequisite for 
this release? 

I would have thought its more of a nice to have but not a requirement 
for this release.

Manuel

On Wed, 31 Aug 2005 09:00 pm, Apache Wiki wrote:
 Dear Wiki user,

 You have subscribed to a wiki page or wiki category on
 Xmlgraphics-fop Wiki for change notification.

 The following page has been changed by ChrisBowditch:
 http://wiki.apache.org/xmlgraphics-fop/ReleasePlanFirstPR

 The comment on the change is:
 added FORay integration

 -
- * The example FO files should more or less work, or at least
 not fail with an exception. * The PDF and PS renderers should have a
 good quality and produce pretty much identical output (almost done) *
 Conditional space support, i.e. space-before.conditionality=discard
 (retain also needs to work but does seem to be currently working) + 
 * Finish integration of FORay Font package.
* Testing and bug fixing.
* Remove hyphenation patterns. Add links to OFFO for hyphenation
 patterns.


 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED] For additional
 commands, e-mail: [EMAIL PROTECTED]


Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Chris Bowditch

Manuel Mall wrote:


Chris,

do you really think that FOray font integration is a prerequisite for 
this release? 

I would have thought its more of a nice to have but not a requirement 
for this release.


You are probably right, but my understanding was that Vincent isn't that 
far away from completing it and I put it up there so it isn't forgotten.


Chris



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Vincent Hennebert

Chris Bowditch a écrit :


The second fo:block does not begin a reference area, so space 
conditionality isn't taken into consideration. For both spaces, 
precedence is not specified so the default value of 0 is used (§ 
7.10.5  7.10.6). The third rule of § 4.3.1 states that between the 
two spaces of the same precedence, the one that has the highest 
(optimum) value wins; here the space-after of the first block.



Well the current implementation doesn't work like that. Both spaces are 
included to give 20pt of space between the two paragraphs.


Then either the implementation is broken (i.e. the spec was misunderstood), or 
this is a not yet implemented feature. No flame here, just for clarity.





I'm not an expert in the details of the spec, but isnt the precendence 
ignored unless conditionality=discard?


No, in fact both notions are orthogonal: conditionality only deals with space 
beginning a reference-area, precedence deals with priorities between several 
successive spaces. They both work independently.





Yes I do agree, with the details you describe. But I wasn't trying to 
drill into detail, I was just saying it's not quite right yet. So my 
point still stands: there is some work still required to get this 
working 100%.




That's fine. I replied because I thought this could help understanding the 
process. We agree that it is yet WIP.
I wish I could do something in this area, as I find this functionality very 
powerful, but I'm currently concentrated on FOrayFont.


Vincent



Re: [Xmlgraphics-fop Wiki] Update of ReleasePlanFirstPR by ChrisBowditch

2005-08-31 Thread Vincent Hennebert

Manuel Mall a écrit :


I would have thought its more of a nice to have but not a requirement 
for this release.


Exactly. If FOrayFont is ready for this release, all the better.
It's difficult to say if it will be. The pdf library is now converted, 
PDFRenderer almost.
I think the PSRenderer and SVG will demand most work. I currently don't know the 
impact on Java2D and RTF renderers.


And when the integration is done there will have to be much debugging and 
non-regression tests IMO...


Vincent