xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keiron Liddle <kei...@aftexsw.com>
Subject Re: Page and Column Breaks
Date Thu, 28 Dec 2000 00:19:46 GMT

Arved Sandstrom wrote:

> Hi, Keiron
> I took a looksee. What I would suggest is, the infrastructure is already set up
> in BodyAreaContainer.java. This area represents the region-body reference area,
> and is responsible for maintaining 3 child areas - one for the main reference
> area, and one each for optional before-floats and footnotes.

I have the footnote reference area under control.

> You can access the BodyAreaContainer (BAC) via the Page - there is a
> blockArea.setPage(area.getPage()) inside the layout() method for Block.java,
> for example. The method getFootnoteReferenceArea() in BodyAreaContainer returns
> the AreaContainer for footnotes. Once this is obtained, I would suggest laying
> out the footnote separator (if present) and the footnote-body into the
> footnoteRefArea AreaContainer, getting that resulting height, and seeing if the
> remaining height available to the main-reference-area can be borrowed from. The
> BAC method getRemainingHeight() may even work already to give you that number.
> :-) In fact, to make this work, you will need to have the available height
> already assigned to the footnoteReferenceArea as its maxHeight, and then it's a
> question of looking at the content height after layout. The maxHeight of the
> footnoteRefArea would need to be trimmed before installing it into the BAC.

The problem with this is that for all of the elements the new area is 
only placed in the area it is doing the layout to after it has placed 
whatever it can in the new area. The best we can do is get the available 
space after completing the current line.

> If the footnote reference area will fit, it can be installed at
> footnoteRefAreaYPosition += footnoteRefArea.getContentHeight(), and that much
> space subtracted from the maxHeight of the main-reference-area. The variable
> footnoteRefAreaYPosition is initially set to be at the bottom of the
> region-reference-area, reflecting a zero-height footnoteRefArea.

Yes, it also needs to subtract the amount from the areas already added 
to the main-reference-area (ie. the columns) and areas that are being 
created and haven't been added yet.

> If it won't fit, then your existing mechanism can be used to carry over to the
> next page. We can ensure that before anything else is laid out on a page (in
> the region-reference-area, that is), that any pending footnotes get laid out
> first. A possible hook to do this is via Flow, which has access to the BAC very
> easily, and can be passed in the pending footnotes from PageSequence. I won't
> speculate further on this at the moment, but it ought to be doable without too
> much agony. 
> This is simplistic, and it certainly doesn't account for humungous footnotes. I
> think that a more complicated algorithm for footnote continuation can maybe
> wait, though. :-)

I agree. The spec is (probably deliberately) vague about where footnotes 
need to be ie. what page etc..

> This will make more sense if you walk through the code in BodyAreaContainer, I
> think. Please ask if you have any questions.
> Regards, Arved

I'll create some examples/tests and put them in cvs to try against.

View raw message