On Thu, 22 Dec 2005 09:25 pm, Florent Georges wrote: > Hi > > I have a strange behaviour with 'linefeed-treatment' set > to 'preserve' and 'text-align' set to 'center' with > FOP-0.90. Given the following FO: > > <?xml version="1.0" encoding="US-ASCII"?> > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> > <fo:layout-master-set> > <fo:simple-page-master master-name="master" > page-height="845pt" > page-width="598pt"> > <fo:region-body margin-left="50pt" > margin-top="50pt" > margin-bottom="50pt" > margin-right="50pt"/> > </fo:simple-page-master> > </fo:layout-master-set> > <fo:page-sequence master-reference="master"> > <fo:flow flow-name="xsl-region-body"> > <fo:block linefeed-treatment="preserve" text-align="center" > padding-top="10pt" padding-bottom="10pt"> > <fo:inline font-weight="bold">Leasing a ...</fo:inline> > <fo:inline>Contrat Nr.: W-113283...</fo:inline> > </fo:block> > </fo:flow> > </fo:page-sequence> > </fo:root> > > I get the following (centered): > > Leasing a ... > Contract Nr.: W-... > > Is the newline expected? If I change the block like this > (add newlines in the second inline): > > <fo:block linefeed-treatment="preserve" text-align="center" > padding-top="10pt" padding-bottom="10pt"> > <fo:inline font-weight="bold">Leasing a ...</fo:inline> > <fo:inline> Contrat Nr.: W-113283...</fo:inline> > </fo:block> > > I still get the same output. If I remove the text-align > attribute, I get the following: > > Leasing a ... > Contract Nr.: W-... > > with or without extra line breaks if I put them or not in > the inline. I guess this is correct (I'm not sure it's > correct to break line if there is no newline in the inline). > > Here is a complete sample showing the differences: > > <?xml version="1.0" encoding="US-ASCII"?> > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> > <fo:layout-master-set> > <fo:simple-page-master master-name="master" > page-height="845pt" > page-width="598pt"> > <fo:region-body margin-left="50pt" > margin-top="50pt" > margin-bottom="50pt" > margin-right="50pt"/> > </fo:simple-page-master> > </fo:layout-master-set> > <fo:page-sequence master-reference="master"> > <fo:flow flow-name="xsl-region-body"> > <fo:block linefeed-treatment="preserve" text-align="center" > padding-top="10pt" padding-bottom="10pt"> > <fo:inline font-weight="bold">Leasing a ...</fo:inline> > <fo:inline>Contrat Nr.: W-113283...</fo:inline> > </fo:block> > <fo:block linefeed-treatment="preserve" text-align="center" > padding-top="10pt" padding-bottom="10pt"> > <fo:inline font-weight="bold">Leasing a ...</fo:inline> > <fo:inline> Contrat Nr.: W-113283...</fo:inline> > </fo:block> > <fo:block linefeed-treatment="preserve" > padding-top="10pt" padding-bottom="10pt"> > <fo:inline font-weight="bold">Leasing a ...</fo:inline> > <fo:inline>Contrat Nr.: W-113283...</fo:inline> > </fo:block> > <fo:block linefeed-treatment="preserve" > padding-top="10pt" padding-bottom="10pt"> > <fo:inline font-weight="bold">Leasing a ...</fo:inline> > <fo:inline> Contrat Nr.: W-113283...</fo:inline> > </fo:block> > </fo:flow> > </fo:page-sequence> > </fo:root> > > The result: > > Leasing a ... > Contract Nr.: W-... > > Leasing a ... > Contract Nr.: W-... > > Leasing a ... > Contract Nr.: W-... > > Leasing a ... > > Contract Nr.: W-... > > Is all this the expected behaviour? > > Regards, > Thanks for the problem description and testcase which made it easy to reproduce and debug.
As it turned out there was a problem with respect to lines who contained only a linefeed (no preceding text) and had a text-align value of "center". For the initiated: it had to do with an incorrect assumption made in the code that a paragraph is not empty if it contains any Knuth element. However, a centered paragraph starts with a glue element and therefore will always have at least one Knuth element even if it only consists of the linefeed (and is therefore empty). > --drkm > Manuel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]