On Mon, Oct 01, 2007 at 06:40:41PM +0200, Andreas L Delmelle wrote:
> One thing I was wondering about: doLineBreaking() is parameterless for the 
> moment. Do you see this changing in the future? i.e. If this method can be 
> called multiple times on the same paragraph, give it a position to start 
> from the second time? So something like
> doLineBreaking(LayoutContext, Position)...?

Probably. I will see that later. When in a best-fit algorithm the page
breaker has determined the page break, and it falls inside a
paragraph, then I plan to keep only that node in the active list, and
rerun the breaking algorithm from there. That should do the trick.

> If I get it correctly now, the LayoutContext is still handled through the 
> LineLM, while somehow I would see the LineLM as receiving the LayoutContext 
> only at the very latest instance. For example, the 
> paragraph-linefiller-width would no longer be stored in the KnuthParagraph 
> itself, but passed into the doLineBreaking() method. (Long shot :S)

The context is that of the LineLayoutLM, and can be determined early
on, like now. Only page-dependent parameters need to be passed in the
call of doLineBreaking(). Insofar as they are now in the layout
context, that needs to be changed.

> I wouldn't think so. Total-fit for me precisely implies taking into account 
> the fact that the available IPD may alter from one page to another. What 
> FOP Trunk currently does in that scenario is definitely not a total-fit, or 
> at least, only in the case the available IPD does not change between pages.
> The key to that is the fact that FlowLM.getNextKnuthElements() gets called 
> only once per fo:flow, and in the base-loop passes on a LayoutContext to 
> its descendants with the IPD of the first page in the page-sequence. This 
> IPD (or a portion thereof) is ultimately used by *all* descendant 
> LineLayoutManagers...

I definitely disagree with you. As we have it now, the total-fit
algorithm needs to have all lines of the page sequence before it can
calculate the best page breaks. Therefore all paragraphs must be
broken into lines before page breaking starts. There is no room for
changing the page widths.

The total-fit algorithm has no point where you can interfere. You need
to give it all information at the start.


Simon Pepping
home page: http://www.leverkruid.eu

Reply via email to