--- Luca Furini <[EMAIL PROTECTED]> wrote: > Another way is to use, instead of > considerLegalBreak(), a different method > to evaluate a possible break point if no breakpoints > are found: this > alternative method would be much simpler, and would > re-create the > behaviour of the old getNextBreakPoss method (add > content to the existing > line if possible, otherwise start another line). > > I think this could be a much better solution: > - it's simpler: it's just another private method in > the LineLM > - it would solve not only this issue with centered > text, but also the > other situations in which the Knuth's algorithm > fails (for example, when > there is a word larger than the line: see Simon's > test file id=12494 for > bug 29124) > > I have already done it, so if you agree I could > create a patch in a short > time. >
Please do--this solution sounds great! (BTW, you have write access already, correct?) > > Also, any chance we can get the Knuth classes > commented so we have a > > better idea what KnuthBox, KnuthPenalty, > KnuthGlue, etc. are for? > > Sure, I should have done this before! > I'll try and comment these files as soon as > possible. > Much appreciated--30 minutes or so of aggressive commenting of the Knuth classes on your part would make a *wonderful* grokkability improvement to this important area of the code. (Please do the commenting in English though, as I'm three generations removed from understanding Italian. ;) [BTW, I'm considering getting that Digital Typography book by Knuth you had mentioned earlier. Do you recommend it? (I was thinking that given all the time I spend on FOP I should start looking a little more at the scientific aspects of this work.)] Thanks, Glen