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 Yuan Yuan <yu...@gmail.com> on 2008/12/31 02:13:03 UTC
FOP Bug or my mistable: Table Cell content string overflow?
Hi,
When I was using the FOP, I found the content string of the Table Cell
overflow all the time.
I have tried to find the solution in the Internet for few days. There are a
lot of explanations, but no directly solution.
I want to know if this is really a bug of FOP or just my mistake (or my
misunderstanding of the "overflow", "wrap-option" and "hyphenate"
attribute)?
Thanks!
Below is my FO xml code.
Please pay attention to this block:
<fo:block-container hyphenate="true" wrap-option="wrap" overflow="scroll">
<fo:block hyphenate="true" wrap-option="wrap" overflow="scroll">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</fo:block>
</fo:block-container>
I really did what I can did for this problem...
<?xml version="1.0" encoding="utf-8" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="normal"
page-height="29.7cm" page-width="21cm" margin-top="1cm"
margin-bottom="1cm" margin-left="1.5cm" margin-right="1.5cm">
<fo:region-body margin-top="1cm" margin-bottom="1cm" />
<fo:region-after extent="0.7cm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="normal">
<fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed" width="100%" border-collapse="collapse"
border-width="0.2mm" border-style="solid" font-size="7pt">
<fo:table-column column-width="30%" />
<fo:table-column column-width="70%" />
<fo:table-body>
<fo:table-row>
<fo:table-cell border-collapse="collapse"
border-width="0.2mm" border-style="solid" padding="2pt">
<fo:block-container hyphenate="true" wrap-option="wrap"
overflow="scroll">
<fo:block hyphenate="true" wrap-option="wrap" overflow="scroll">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell border-collapse="collapse"
border-width="0.2mm" border-style="solid" padding="2pt">
<fo:block-container hyphenate="true" wrap-option="wrap"
overflow="scroll">
<fo:block hyphenate="true" wrap-option="wrap" overflow="scroll">
=======================================================================================================
</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
Re: FOP Bug or my mistable: Table Cell content string overflow?
Posted by Andreas Delmelle <an...@telenet.be>.
On 31 Dec 2008, at 02:13, Yuan Yuan wrote:
Hi
> When I was using the FOP, I found the content string of the Table
> Cell overflow all the time.
>
> I have tried to find the solution in the Internet for few days.
> There are a lot of explanations, but no directly solution.
>
> I want to know if this is really a bug of FOP or just my mistake (or
> my misunderstanding of the "overflow", "wrap-option" and "hyphenate"
> attribute)?
Well, there is the small matter of wrap-option="wrap". This does not /
force/ line-wrapping, especially not in FOP. FOP uses Unicode TR14
line-breaking rules, and Unicode does not allow breaking that long
string of a's anywhere.
Normally, hyphenate="true" should be enough to achieve what you need,
but I notice you do not specify a language anywhere, yielding a
default of language="none".
I'm guessing FOP doesn't hyphenate because it does not get an
indication of which hyphenation pattern to use here?
To properly activate hyphenation in FOP, check the following links:
http://xmlgraphics.apache.org/fop/0.95/hyphenation.html
http://offo.sourceforge.net/
Note that hyphenation will only take care of the string of a's (could
be conceived as a 'word'). The string of ='s will still not be
hyphenated, since it is not a word. The only way to force splitting
those over multiple lines, at the moment, is to insert Zero-Width
Spaces to allow FOP to insert breaks in there...
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org