You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Simon Pepping <sp...@leverkruid.nl> on 2004/05/23 21:15:12 UTC

Re: [Bug 29124] New: - New line breaking algorithm

Hi Luca,

On Thu, May 20, 2004 at 03:30:13PM -0000, bugzilla@apache.org 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



missing karma (was: Re: [Bug 29124] New: - New line breaking algorithm)

Posted by Jeremias Maerki <de...@greenmail.ch>.
Simon,

I've just sent a note about that. I hope you (and Clay) will have karma
soon. It seems to have been forgotten. I don't think I have the
necessary powers to add karma myself. Even if I had I wouldn't know what
to do. By now I know a lot about Subversion, but still almost nothing
about CVS (on the server). I'm sorry that it went wrong.

On 23.05.2004 21:15:12 Simon Pepping wrote:
> I would have applied them (as amended by myself) if I would have had
> karma.


Jeremias Maerki