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 Green <gr...@jaid.ca> on 2005/04/07 05:12:26 UTC

solved anther centering problem.

Hi,

I am new for this mailing list although I have been using FOP for about
a year.

Anyway, I had a couple of problems and solved them. 
So, I would like to share with you.

Centering is the first one.
I had stylesheet like this.

<fo:table-cell 
    border-style="solid" border="0.1pt" border-color="#ffffff">
    <fo:block font-size="8pt" color="#000000" 
        font-family="Bell Gothic Bold" 
        font-weight="bold" text-align="center">
            <xsl:value-of select="./total"/>
    </fo:block>
</fo:table-cell>

By chance I found adding invisible border solve the problem.
But still had some problem and found this thread
http://marc.theaimsgroup.com/?l=fop-user&m=110561184109768&w=3 
so, kerning=no in userconfig.xml But again still text was slightly left.

again by chance I changed to like this

<fo:table-cell 
    border-style="solid" border="0.1pt" border-color="#ffffff">
    <fo:block font-size="8pt" color="#000000" 
        font-family="Bell Gothic Bold" 
        font-weight="bold" text-align="center">
            <xsl:value-of select="./value"/></fo:block>
</fo:table-cell>

i.e. no linefeed between value-of and close block.

It worked perfectly.

Looks like FOP counts line feed as one character to calculate centering
position.


Green



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: solved anther centering problem.

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Green wrote:
>         font-weight="bold" text-align="center">
>             <xsl:value-of select="./value"/></fo:block>
> </fo:table-cell>
> 
> i.e. no linefeed between value-of and close block.
> 
> It worked perfectly.
> 
> Looks like FOP counts line feed as one character to calculate centering
> position.

That's odd, because the whitespace should have been stripped off by the 
XSLT processor, so FOP shouldn't even see this. I'm pretty sure it hase
something to do with your source XML (you select different data in the
code snippets). And yes, FOP does have trouble with whitespace at the
end of a fo:block.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org