Hello Steve, Hello Foppers I had the the same problem too and I have developed some test cases where I could test the problem mentioned here under 2). I have attached the diff (and the test cases) which should resolves the problem. I not a commiter so it would be grateful if someone merges the code. regarding the first problem: are you printing under windows with acrobat reader 4.0 and up? Try printing on a different printer. I have similar problems with WinNT and Acrobat Reader 4 an 5 when I am printing to a HP LaserJet 4M+. As a "special effect": If the same file is printed via a DDE connection the resulting page is scaled in height to about 80 to 90 percent - it depents on the printer I am using ;-) This might be a problem within PDFDocument Am Dienstag, 21. August 2001 18:58 schrieben Sie: > PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT > ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW > AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE > DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL > BE LOST SOMEWHERE. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3208 > > *** shadow/3208 Tue Aug 21 09:58:18 2001 > --- shadow/3208.tmp.4288 Tue Aug 21 09:58:18 2001 > *************** > *** 0 **** > --- 1,30 ---- > + > +========================================================================== >==+ + | Blocks aligned incorrectly in PDF > | + > +-------------------------------------------------------------------------- >--+ + | Bug #: 3208 Product: Fop > | + | Status: NEW Version: all > | + | Resolution: Platform: PC > | + | Severity: Normal OS/Version: > Windows 9x | + | Priority: Other > Component: pdf renderer | + > +-------------------------------------------------------------------------- >--+ + | Assigned To: [EMAIL PROTECTED] > | + | Reported By: [EMAIL PROTECTED] > | + | CC list: Cc: > | + > +-------------------------------------------------------------------------- >--+ + | URL: > | + > +========================================================================== >==+ + | DESCRIPTION > | + 1) The measurement of blocks both horizontally and vertically do > not seem to + add up correctly (e.g. I have a block defined as 19cm wide, > but it prints as + being about 17.8 cms; and a block 17cms in height only > printed as around 16 + cms). > + > + Somebody else did a similar test (after raising the issue in fop-dev) and > they + found that a 6inch column results in 5.625inches. > + > + 2) in a table definition (again using -pdf renderer) the contents of one > column + are "creeping" to the left even though the "end" position is > defined. It seems + to occur when the contents of a previous column has > little or no text. (In my + test I had one column with lots of W's > starting with 10-W's on row-1, reducing + to 1W on row-10; at row-8 with > only 3-W's - the contents of the second column + start to get dragged over > to the left.) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED]
? LineArea.java.diff Index: LineArea.java =================================================================== RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/layout/LineArea.java,v retrieving revision 1.49 diff -u -r1.49 LineArea.java --- LineArea.java 2001/08/02 19:38:08 1.49 +++ LineArea.java 2001/08/21 19:58:33 @@ -429,27 +429,42 @@ wordWidth = 0; return i; } - if (wordStart == start) { // if couldn't even fit - // first word - overrun = true; - // if not at start of line, return word start - // to try again on a new line - if (finalWidth > 0) { - return wordStart; - } - } else if (this.wrapOption == WrapOption.WRAP) { + + if (this.wrapOption == WrapOption.WRAP) { + + int ret=wordStart; + if (hyphProps.hyphenate == Hyphenate.TRUE) { - return this.doHyphenation(dataCopy, i, wordStart, - this.getContentWidth() - - (finalWidth - + spaceWidth - + pendingWidth)); - } else { - return wordStart; + ret = this.doHyphenation(dataCopy, i, wordStart, + this.getContentWidth() + - (finalWidth + + spaceWidth + + pendingWidth)); + + } + + + if ((ret == wordStart) && // current word couldn't be hypenated + (wordStart == start) && // couldn't fit first word + (finalWidth == 0)) { // I am at the beginning of my line + + MessageHandler.error(">"); + + addSpacedWord(new String(data, wordStart, wordLength - 1), + ls, + finalWidth + spaceWidth + + embeddedLinkStart, + spaceWidth, textState, false); + + finalWidth += wordWidth; + wordWidth = 0; + + ret = i; } + + return ret; } } - } } // end of iteration over text
<?xml version="1.0" ?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="first"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-name="first" language="de"> <fo:flow flow-name="xsl-region-body"> <fo:block>Configuration: wrap-option="wrap" hyphenate="true"</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:block>I have some testcases where the hypenation does not work correctly. It inserts an InlineSpace before the hypenated word starts.</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:table wrap-option="wrap" hyphenate="true"> <fo:table-column column-width="5cm"/> <fo:table-column column-width="10cm"/> <fo:table-body> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>ThisIsTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word after starting words:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. ThisIsNotTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars after starting words</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> <fo:block break-before="page">Configuration: wrap-option="no-wrap" hyphenate="true"</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:block>This seems to be handled correctly.</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:table wrap-option="no-wrap" hyphenate="true"> <fo:table-column column-width="5cm"/> <fo:table-column column-width="10cm"/> <fo:table-body> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>ThisIsTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word after starting words:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. ThisIsNotTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars after starting words</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> <fo:block break-before="page">Configuration: wrap-option="wrap" hyphenate="false"</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:block>This Page is now handled correctly.</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:table wrap-option="wrap" hyphenate="false"> <fo:table-column column-width="5cm"/> <fo:table-column column-width="10cm"/> <fo:table-body> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>ThisIsTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word after starting words:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. ThisIsNotTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars after starting words</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> <fo:block break-before="page">Configuration: wrap-option="no-wrap" hyphenate="false"</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:block>This seems to be handled correctly.</fo:block> <fo:block white-space-collapse="false"> </fo:block> <fo:table wrap-option="no-wrap" hyphenate="false"> <fo:table-column column-width="5cm"/> <fo:table-column column-width="10cm"/> <fo:table-body> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>ThisIsTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long word after starting words:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. ThisIsNotTheFirstWordOfTheCurrentLineTheWordCouldBeHypenated!</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars:</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block white-space-collapse="false"> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>fo:block with a very long line of chars after starting words</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>Short words. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>Text for second cell.</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:flow> </fo:page-sequence> </fo:root>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]