Hi, Andreas Delmelle wrote: > On 18 Jun 2009, at 20:26, Simon Pepping wrote: > > Hi Simon, Vincent, > >> <snip /> >> I get the feeling that this means that you are planning to relaunch >> line breaking while in the page breaking phase.
Yes. >> Is that possible? That’s what I am currently trying to figure out. Getting the index of the last element on the previous page is not too difficult, restarting element generation and resetting all applicable variables is harder. > What I was wondering too, and why I somehow believe that suspending > line-breaking and starting the page-breaking phase earlier is likely to > be 'easier' to implement (even though the required changes would impact > a lot more classes). It would basically come down to extending the > approach that is currently taken when dealing with span-changes or > forced page- or column-breaks: exit the line-breaking loop, start > page-breaking for the element-list up to that point, and return later to > continue with the line-breaking. Currently, this approach always uses > separate PageBreakingAlgorithm instances, but I don't think it would be > very hard to re-use the same PBA and append the new elements to its > 'current paragraph'. Until page breaking has been done you don’t know where the paragraph will be broken. So you don’t know how far in the element generation you must go. >> It is a bit strange that changing IPD would waste CPU cycles, as it >> could be achieved by the simpler of two strategies, best-fit versus >> total-fit. Theoretically speaking it shouldn’t, in practice the code is not designed to switch back and forth from line generation to page generation. Throwing the elements away and re-creating them with the new page width in mind appears to be simpler to achieve, and should be good enough for this short-term solution. >> But maybe implementing best-fit next to total-fit would be >> more than a simple solution. >> >> I agree that it would be an improvement to have even a partial >> solution for the changing IPD feature. Good luck with this necessary >> job. Thanks :-) Vincent
