Glen Mazza wrote:
A further optimization might be to do all this before
the Block is even parsed into FOText and Inline
objects, as many spaces-only objects would end up not
even needing to be created.

This will not account for spaces to be removed around line breaks.

My preferred solution is to combine space processing with
break calculation. This needs some sort of status passed
through to the layout managers, perhaps as part of the
layout context. But then, proper TR14 line breaking needs
a precious character LB property and a whitespace status
too, so this can be combined. The processing would be
roughly as follow:
 *for* word *in* text (separated by whitespace)
   normalize the whitespace (optimize normalization away
    for some whitespace status).
   calculate TR14 breaks at the beginning of the word
   *for* TR14 break possiblities *in* word
     *if* line full
        check hyphenations
        return previous break possiblity
   *end for*
 *end for*


Reply via email to