You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Vincent Hennebert <vi...@anyware-tech.com> on 2007/11/02 11:12:33 UTC

Re: hyphenation problem

Hi Kumar,

Sorry for the delay, looks like I ended up forgetting this thread.

Puppala, Kumar (LNG-CON) wrote:
> Hi Vicent,
>    I am not sure if I understand you. If you look at newFop.pdf(from
> previous mail), the 14th line in the table cell ( 'sion scheme') has the
> overflow. It looks like the word 'scheme' started at the very edge of
> the table cell and the hyphenation did not occur. The oldFop.pdf file
> (generated using 0.20.5) demonstrates the correct behavior. 

The word ‘scheme’ cannot be hyphenated, so it can only be placed on one 
single line. But as it is wider than the column width, it would overflow 
the column anyway.

What you see and which looks strange is a result of the total-fit 
algorithm: FOP optimizes line breaks for the whole paragraph, instead of 
working one line at a time. If it chose to put ‘sion scheme’ on one 
line, that’s because that leads to an less bad overall result than if it 
had cut it.

That’s the best it can do in such a special situation. Really, you 
should make sure that the column is at least wide enough to make all the 
syllables fit on one line.


> The testcase does come from real-life usecases. In some of our usecases,
> we do have table cells that accommodate only 1 character (which is
> usually a number).

Ok, but if you actually put only one character in such cells, you won’t 
have any problem.

HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: hyphenation problem

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
Hi Kumar,

Puppala, Kumar (LNG-CON) wrote:
> Hi Vicent,
>    Thanks for the explanation for the FOP behavior that I am noticing.
> In the testcase that I sent out earlier, there are some situations where
> the word starts right on the border (for example, in 'on an employee's'
> text, the last word start right on the border). Regardless of the
> total-fit algorithm, I would have expected the word to start on the next
> line instead of beginning on the table border. 
> 
> Our data contains all kinds of languages and special characters and it
> is difficult to control what comes to us. We definitely need to go with
> the approach where the word flows to the next line if it cannot fit
> within the table-cell borders. The current total-fit algorithm does not
> bode well with our system and I would like to make changes in my local
> copy to get the desired behavior (as rendered by old FOP). If you can
> point me in the right direction to accomplish this, I would greatly
> appreciate.

I see your problem. Note that FOP 0.20.5’s behaviour was probably not 
compliant, and really leads to poor results...
Anyway, I think the simplest way for you to achieve this is to put 
zero-width spaces between each letter of the words, in a preliminary 
process before feeding the FO to FOP. Hyphenation will then no longer be 
necessary.

HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: hyphenation problem

Posted by "Puppala, Kumar (LNG-CON)" <ku...@lexisnexis.com>.
Hi Vicent,
   Thanks for the explanation for the FOP behavior that I am noticing.
In the testcase that I sent out earlier, there are some situations where
the word starts right on the border (for example, in 'on an employee's'
text, the last word start right on the border). Regardless of the
total-fit algorithm, I would have expected the word to start on the next
line instead of beginning on the table border. 

Our data contains all kinds of languages and special characters and it
is difficult to control what comes to us. We definitely need to go with
the approach where the word flows to the next line if it cannot fit
within the table-cell borders. The current total-fit algorithm does not
bode well with our system and I would like to make changes in my local
copy to get the desired behavior (as rendered by old FOP). If you can
point me in the right direction to accomplish this, I would greatly
appreciate.


Thanks,
Kumar Puppala

-----Original Message-----
From: Vincent Hennebert [mailto:vincent.hennebert@anyware-tech.com] 
Sent: Friday, November 02, 2007 6:13 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: hyphenation problem

Hi Kumar,

Sorry for the delay, looks like I ended up forgetting this thread.

Puppala, Kumar (LNG-CON) wrote:
> Hi Vicent,
>    I am not sure if I understand you. If you look at newFop.pdf(from
> previous mail), the 14th line in the table cell ( 'sion scheme') has
the
> overflow. It looks like the word 'scheme' started at the very edge of
> the table cell and the hyphenation did not occur. The oldFop.pdf file
> (generated using 0.20.5) demonstrates the correct behavior. 

The word 'scheme' cannot be hyphenated, so it can only be placed on one 
single line. But as it is wider than the column width, it would overflow

the column anyway.

What you see and which looks strange is a result of the total-fit 
algorithm: FOP optimizes line breaks for the whole paragraph, instead of

working one line at a time. If it chose to put 'sion scheme' on one 
line, that's because that leads to an less bad overall result than if it

had cut it.

That's the best it can do in such a special situation. Really, you 
should make sure that the column is at least wide enough to make all the

syllables fit on one line.


> The testcase does come from real-life usecases. In some of our
usecases,
> we do have table cells that accommodate only 1 character (which is
> usually a number).

Ok, but if you actually put only one character in such cells, you won't 
have any problem.

HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org