Hi Luca,

On Thu, May 20, 2004 at 03:30:13PM -0000, [EMAIL PROTECTED] wrote:
> 
> Ok, so here is the patch I was talking about in the fop-dev mailing list.

This is a strong and careful piece of work.

> Some implementation notes:
> 1)
> In order to minimize changes in other files, the LLM interacts with the TLM 
> calling brand new methods that I added to the LayoutManager interface, 
> providing null implementation in the AbstractLayoutManager. I also added a 
> KnuthPossPosIter, which is almost a clone of BreakPossPosIter.
> I think a much more elegant solution would be having the LLM call 
> getNextBreakPoss, and casting the returned object to KnuthElement. Maybe 
> BreakPoss and KnuthElement could be subclasses of a same class, abstract, 
> containing only a Position object and the method to access it:
> 
>         BreakPoss (same name, but a different class)
>             |
>      ---------------
>      |             |
>  KnuthElement    TheClassPreviouslyKnownAsBreakPoss
> 
> All LM call getNextBreakPoss, but the LLM casts to KnuthElement and the other 
> LM cast to "TheClassPreviouslyKnownAsBreakPoss"

I would prefer the more elegant solution.

Your comment:
// QUESTION: maybe LayoutContext holds the Properties which
// come from block-level?

Answer: LayoutContext is the vehicle to pass data from one LM to its
child LMs.

> The LLM tries the first time to find breaking point without word hyphenation; 
> only if it doesn't find a set of break points, it calls again the algorithm 
> after having hyphenated all words, so this patch includes the ones concerning 
> hyphenation (bug 27773) and hyphenation of word with punctuation marks (bug 
> 28431).

I would have applied them (as amended by myself) if I would have had
karma.

> I tried to use the old information (about the whole words) as much as 
> possible, but I don't know whether this saves some time or it is just an 
> unneeded complication.

findHyphenationPoints(Paragraph currPar) seems to be a fairly
complicated piece of code. Would it not be easier to rebuild the
paragraph from scratch, this time with hyphenation? The existing
method AbstractLayoutManager.reset(Position pos) could be used to
reset the childLMs and the iterator over them.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl


Reply via email to