This first attempt didn't work out. Sometimes the demerit would still be
bigger than the one for the constellation that generated more than one
part. However, I found a clean hook-in point in filterActiveNodes()
where I can make sure that the "squeezing solution" is favored over the
breaking one. The test case will also serve as a concrete example of a
use case.

See:
http://svn.apache.org/viewcvs?rev=396915&view=rev

On 20.04.2006 13:56:01 Jeremias Maerki wrote:
> I've done a local hack that tries to squeeze all content of a
> block-container into the available area if that's possible based on the
> available "shrink". I've done this by modifying
> PageBreakingAlgorithm.computeDemerits():
> 
>         [..]
>         demerits += activeNode.totalDemerits;
>         if (singlePartMode && activeNode.line > 0) {
>             demerits += 1000;
>         }
>         return demerits;
> 
> singlePartMode is a boolean which is true when processing a
> block-container. The same could be used for static-content.
> 
> This will increase the demerits a lot if the breaker tries to create
> more than one part/line and indirectly forces the breaker to use the
> shrink value. Is that a good solution or does anyone have a better idea?
> 
> Thanks,
> Jeremias Maerki



Jeremias Maerki

Reply via email to