Re: Bug 49837 - Soft Hyphen
On Thu, Dec 02, 2010 at 07:12:08PM +0200, Klearchos Klearchou wrote: I have Fop version 0.95 and I am trying to upgrade to 1.0 but I have problems with the following regression bug (49837 https://issues.apache.org/bugzilla/show_bug.cgi?id=49837 ). Is there any workaround for this? The problem occurs when a soft-hyphen follows white-space or is the first character in a block. You can work around it by avoiding those situations. If you encounter the problem in other situations, please, let us know. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Bug 49837 - Soft Hyphen
Hello Simon, Thank you for answering I was about to write a new mail. I have changed the code at the class (org.apache.fop.traits.MinOptMax). Here is the change: public MinOptMax mult(int factor) { if (factor 0) { factor = 0; } if (factor == 1) { return this; } else { return getInstance(min * factor, opt * factor, max * factor); } } Basically instead of throwing an Exception I set the value to 0 and I let it return the getInstance(min * factor, opt * factor, max * factor). I am currently checking the code and it seems that the PDFs look ok and of course there is no exception. Could you please tell me if this could have any side-effect since I do not have lot of experience with the FOP source. Kind regards, Klearchos -Original Message- From: Simon Pepping [mailto:spepp...@leverkruid.eu] Sent: Friday, December 03, 2010 12:14 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Bug 49837 - Soft Hyphen On Thu, Dec 02, 2010 at 07:12:08PM +0200, Klearchos Klearchou wrote: I have Fop version 0.95 and I am trying to upgrade to 1.0 but I have problems with the following regression bug (49837 https://issues.apache.org/bugzilla/show_bug.cgi?id=49837 ). Is there any workaround for this? The problem occurs when a soft-hyphen follows white-space or is the first character in a block. You can work around it by avoiding those situations. If you encounter the problem in other situations, please, let us know. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Bug 49837 - Soft Hyphen
Hi Simon, wouldn't it be possible to partially undo the changes from this bugzilla entry: https://issues.apache.org/bugzilla/show_bug.cgi?id=48071 It's really hard to control that soft-hyphen characters are placed correctly when users can copy paste text into content (as in our CMS). Regards, Matthias Reischenbacher Simon Pepping @ Home wrote: On Thu, Dec 02, 2010 at 07:12:08PM +0200, Klearchos Klearchou wrote: I have Fop version 0.95 and I am trying to upgrade to 1.0 but I have problems with the following regression bug (49837 https://issues.apache.org/bugzilla/show_bug.cgi?id=49837 ). Is there any workaround for this? The problem occurs when a soft-hyphen follows white-space or is the first character in a block. You can work around it by avoiding those situations. If you encounter the problem in other situations, please, let us know. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Bug-49837---Soft-Hyphen-tp30360601p30366538.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Bug 49837 - Soft Hyphen
On Fri, Dec 03, 2010 at 12:17:43PM +0200, Klearchos Klearchou wrote: Hello Simon, Thank you for answering I was about to write a new mail. I have changed the code at the class (org.apache.fop.traits.MinOptMax). Here is the change: public MinOptMax mult(int factor) { if (factor 0) { factor = 0; } if (factor == 1) { return this; } else { return getInstance(min * factor, opt * factor, max * factor); } } Basically instead of throwing an Exception I set the value to 0 and I let it return the getInstance(min * factor, opt * factor, max * factor). I am currently checking the code and it seems that the PDFs look ok and of course there is no exception. Could you please tell me if this could have any side-effect since I do not have lot of experience with the FOP source. That is a quick hack, and it might well have any side effects. Can you tell us your use case: Why do you want to process fo files with a soft hyphen after a white space or at the start of a block? I will try to find out how the factor can be -1; it should not. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Bug 49837 - Soft Hyphen
Hello Simon and All, I noticed that there was a series of characters in one of my texts that was included inside the FO (space - space). I have removed the - and retyped it. Possibly it has been copied from a word document and it was somehow different. By doing this the problem disappeared. I was able to find the same pattern in other many places and I thought that this was not a good solution. So I tried to check the source code. I do not do anything special. Basically I print out the text mentioned previously (XSLT): xsl:value-of select=$title/ I agree that this could have many side-effects but up to now I haven't seen anything bad at the generated PDFs. What could go wrong? For example missing characters or overlapping text? Regards, Klearchos -Original Message- From: Simon Pepping [mailto:spepp...@leverkruid.eu] Sent: Friday, December 03, 2010 1:55 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Bug 49837 - Soft Hyphen On Fri, Dec 03, 2010 at 12:17:43PM +0200, Klearchos Klearchou wrote: Hello Simon, Thank you for answering I was about to write a new mail. I have changed the code at the class (org.apache.fop.traits.MinOptMax). Here is the change: public MinOptMax mult(int factor) { if (factor 0) { factor = 0; } if (factor == 1) { return this; } else { return getInstance(min * factor, opt * factor, max * factor); } } Basically instead of throwing an Exception I set the value to 0 and I let it return the getInstance(min * factor, opt * factor, max * factor). I am currently checking the code and it seems that the PDFs look ok and of course there is no exception. Could you please tell me if this could have any side-effect since I do not have lot of experience with the FOP source. That is a quick hack, and it might well have any side effects. Can you tell us your use case: Why do you want to process fo files with a soft hyphen after a white space or at the start of a block? I will try to find out how the factor can be -1; it should not. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Bug 49837 - Soft Hyphen
Hi Klearchos, The following patch solves the problem: Index: src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java === --- src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (revision 1041771) +++ src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (working copy) @@ -813,6 +813,10 @@ } } int letterSpaces = wordLength - 1; +// a word consisting of only a soft hyphen, has wordLenght == 0 +if (wordLength == 0) { +letterSpaces = 0; +} // if there is a break opportunity and the next one // is not a space, it could be used as a line end; // add one more letter space, in case other text follows I will commit it after I have constructed the test case. Your patch would indeed produce the correct result, as it has essentially the same effect as my above patch. On Fri, Dec 03, 2010 at 02:10:02PM +0200, Klearchos Klearchou wrote: Hello Simon and All, I noticed that there was a series of characters in one of my texts that was included inside the FO (space - space). I have removed the - and retyped it. Possibly it has been copied from a word document and it was somehow different. So it is a machine-generated thing. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Bug 49837 - Soft Hyphen
On Fri, Dec 03, 2010 at 03:40:57AM -0800, Matthias Reischenbacher wrote: Hi Simon, wouldn't it be possible to partially undo the changes from this bugzilla entry: https://issues.apache.org/bugzilla/show_bug.cgi?id=48071 It is not really undoing the changes of that patch. That patch introduced checking preconditions for the method, and by doing this revealed an error that had gone unnoticed before. So I am removing the real error. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Bug 49837 - Soft Hyphen
Simon, many thanks about your update. Best positive regards, Klearchos -Original Message- From: Simon Pepping [mailto:spepp...@leverkruid.eu] Sent: Friday, December 03, 2010 3:46 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Bug 49837 - Soft Hyphen Hi Klearchos, The following patch solves the problem: Index: src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java === --- src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (revision 1041771) +++ src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (working copy) @@ -813,6 +813,10 @@ } } int letterSpaces = wordLength - 1; +// a word consisting of only a soft hyphen, has wordLenght == 0 +if (wordLength == 0) { +letterSpaces = 0; +} // if there is a break opportunity and the next one // is not a space, it could be used as a line end; // add one more letter space, in case other text follows I will commit it after I have constructed the test case. Your patch would indeed produce the correct result, as it has essentially the same effect as my above patch. On Fri, Dec 03, 2010 at 02:10:02PM +0200, Klearchos Klearchou wrote: Hello Simon and All, I noticed that there was a series of characters in one of my texts that was included inside the FO (space - space). I have removed the - and retyped it. Possibly it has been copied from a word document and it was somehow different. So it is a machine-generated thing. Simon - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Bug 49837 - Soft Hyphen
Hello to All, I have Fop version 0.95 and I am trying to upgrade to 1.0 but I have problems with the following regression bug (49837 https://issues.apache.org/bugzilla/show_bug.cgi?id=49837 ). Is there any workaround for this? I found that if I retype some specific hyphens (that used to look like boxes from my TOAD) it worked. Regards