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 "Schweigl, Johann" <Jo...@softwareag.com> on 2002/08/01 13:56:00 UTC

Keep text within a line

I cannot convince Apache FOP to keep the output of the following FO fragment
(which is contained in a xsl-region-after) within a single line:

<fo:block font-size="8pt" start-indent="39mm" border-top="solid"
border-width="0.1mm" text-align-last="justify">&#x00a9; aaaaaaaa bbbbb
ccccccc<fo:leader leader-pattern="space"/>Page <fo:page-number/></fo:block>

keep-together.within-line, which i tried, doesnt have any effect at all, a
line break is produced after bbbbb, although there is enough space on the
line to keep everything together. Even worse, between the text "Page" and
the page number there is about 10 mm space ...

looks like 
----------------------------------------------------------------------------
-----------------------
aaaaaaaa bbbbb 
ccccccc
Page        1


instead of
----------------------------------------------------------------------------
-----------------------
aaaaaaaa bbbbb ccccccc
Page 1


Antennahouse XSL Formatter produces the latter, which is what I would
expect. Anything wrong with my FO or a bug in FOP?

Re: Keep text within a line

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Schweigl, Johann wrote:
> I cannot convince Apache FOP to keep the output of the following FO fragment
> (which is contained in a xsl-region-after) within a single line:
> 
> <fo:block font-size="8pt" start-indent="39mm" border-top="solid"
> border-width="0.1mm" text-align-last="justify">&#x00a9; aaaaaaaa bbbbb
> ccccccc<fo:leader leader-pattern="space"/>Page <fo:page-number/></fo:block>

This is a problem with generating leaders, the default is to take 100% of
available space. Line break calculation takes this into account, so that the
page number goes to the next line.


> keep-together.within-line, which i tried, doesnt have any effect at all,
Is not implemented yet.

> Even worse, between the text "Page" and
> the page number there is about 10 mm space ...
This is the fo:leader.

> aaaaaaaa bbbbb ccccccc
> Page 1

If you want to have this, use two fo:blocks.

J.Pietschmann