[
https://issues.apache.org/jira/browse/FOP-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dan Caprioara updated FOP-2809:
-------------------------------
Description:
The text should be presented on two lines (they are separated by line breaks -
not by wrapping - is plenty of space in the page):
{quote}
line1 line1 line1 line1 LINE1
line2
{quote}
Instead it is on three lines.
{quote}
line1 line1 line1 line1
LINE1
line2
{quote}
The snippet:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xml:lang="en-us">
<fo:layout-master-set>
<fo:simple-page-master master-name="css2fo-default" page-width="8.5in"
page-height="11in">
<fo:region-body margin="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="css2fo-default"
force-page-count="no-force"
id="last-page-sequence" line-height-shift-adjustment="disregard-shifts">
<fo:flow flow-name="xsl-region-body">
<fo:block-container>
<fo:block linefeed-treatment="preserve"
wrap-option="wrap"><fo:inline>line1 line1 <fo:inline>line1 line1
LINE1</fo:inline>
<fo:inline>line2</fo:inline></fo:inline></fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>
{code}
If you add more words to the example, you will see that it always add a break
before the second-to-last word.
If you remove the inline: {{<fo:inline>line2</fo:inline>}} and leave just the
{{line2}} text, this corrects the problem. The same if you remove the tags of
any inline.
was:
The text should be presented on two lines:
{quote}
line1 line1 line1 line1 LINE1
line2
{quote}
But is like this, on three lines.
{quote}
line1 line1 line1 line1
LINE1
line2
{quote}
The snippet:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xml:lang="en-us">
<fo:layout-master-set>
<fo:simple-page-master master-name="css2fo-default" page-width="8.5in"
page-height="11in">
<fo:region-body margin="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="css2fo-default"
force-page-count="no-force"
id="last-page-sequence" line-height-shift-adjustment="disregard-shifts">
<fo:flow flow-name="xsl-region-body">
<fo:block-container>
<fo:block linefeed-treatment="preserve"
wrap-option="wrap"><fo:inline>line1 line1 <fo:inline>line1 line1
LINE1</fo:inline>
<fo:inline>line2</fo:inline></fo:inline></fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>
{code}
If you add words to the example, you will see that it always add a break before
the second-to-last word.
If you remove the inline: {{<fo:inline>line2</fo:inline>}} and leave just the
{{line2}} text, this corrects the problem. The same if you remove the tags of
any inline.
> Excessive wrap when having linefeed-treatment="preserve" and inlines
> --------------------------------------------------------------------
>
> Key: FOP-2809
> URL: https://issues.apache.org/jira/browse/FOP-2809
> Project: FOP
> Issue Type: Bug
> Components: layout/line
> Affects Versions: 2.3
> Reporter: Dan Caprioara
> Priority: Major
>
> The text should be presented on two lines (they are separated by line breaks
> - not by wrapping - is plenty of space in the page):
> {quote}
> line1 line1 line1 line1 LINE1
> line2
> {quote}
> Instead it is on three lines.
> {quote}
> line1 line1 line1 line1
> LINE1
> line2
> {quote}
> The snippet:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
> xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xml:lang="en-us">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="css2fo-default" page-width="8.5in"
> page-height="11in">
> <fo:region-body margin="1in"/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence master-reference="css2fo-default"
> force-page-count="no-force"
> id="last-page-sequence" line-height-shift-adjustment="disregard-shifts">
> <fo:flow flow-name="xsl-region-body">
> <fo:block-container>
> <fo:block linefeed-treatment="preserve"
> wrap-option="wrap"><fo:inline>line1 line1 <fo:inline>line1 line1
> LINE1</fo:inline>
> <fo:inline>line2</fo:inline></fo:inline></fo:block>
> </fo:block-container>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
> {code}
> If you add more words to the example, you will see that it always add a break
> before the second-to-last word.
> If you remove the inline: {{<fo:inline>line2</fo:inline>}} and leave just the
> {{line2}} text, this corrects the problem. The same if you remove the tags
> of any inline.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)