xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29124] - New line breaking algorithm
Date Tue, 17 Aug 2004 13:51:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29124>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29124

New line breaking algorithm





------- Additional Comments From lfurini@cs.unibo.it  2004-08-17 13:51 -------
Oops, sorry again, Simon!

In the code I used when creating the last patch there was an error affecting 
the TextLayoutManager.getChangedKnuthElements() method: two missing "break" 
inside a switch.
Due to this error, the sequence of elements generated for each space (when 
text-align is center, start or end) is wrong, and some text "disappears" (I 
even got IndexOutOfBounds exceptions).
Inserting these breaks is enough to make everything work:

    ...
    // ai refers to a space
    switch (alignment) {
        case CENTER : ...
                      iReturnedIndex ++;
                      break;             /* this was missing */
        case START  : // fall through
        case END    : ...
                      iReturnedIndex ++;
                      break;             /* this was missing */
        case JUSTIFY: ...
    }
    ...

As you can see, in the last patch I changed the getNextKnuthElements() and 
getChangedKnuthElements() return type, so they now return a sequence of 
elements instead of a single one.
This maybe reduces similarities between getNextKnuthElements() and 
getNextBreakPoss(), but I think it makes the code simpler and easier to 
understand. Maybe it would be even better to make them return the whole 
sequence, so that these methods are called once per LM.

Now I'm working on the newly-created LMs, so next patch (which I think will be 
ready tomorrow) will apply to the latest code version and will include Finn 
Bock's changes.

Regards,
    Luca

Mime
View raw message