W3C home > Mailing lists > Public > www-xsl-fo@w3.org > February 2008

Re: Upside down text in the table

From: Jeremias Maerki <dev@jeremias-maerki.ch>
Date: Wed, 06 Feb 2008 08:38:07 +0100
To: www-xsl-fo@w3.org
Message-Id: <20080206083602.672E.DEV@jeremias-maerki.ch>

You've hit a known bug in Apache FOP which, unfortunately, still hasn't
been fixed, yet. As a work-around you could use SVG to rotate the text.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36391

On 05.02.2008 06:24:51 fat bold cyclop wrote:
> 
> I work on XML->XSL-FO->PDF tranformation that would produce Tsumeshogi
> problems in pdf format. In Shogi diagrams the pieces are often rotated
> (black pieces are placed heads up, white - heads down).
> 
> I need some cells of my table to be rotated by 180 deg.
> I achieve this by:
> 
> <?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="first"
> page-height="29.7cm" page-width="21cm" margin-top="1cm"
>                                margin-bottom="1cm" margin-left="2.5cm"
> margin-right="2.5cm">
>             <fo:region-body margin-top="1.5cm" margin-bottom="1.5cm"/>
>         </fo:simple-page-master>
>     </fo:layout-master-set>
> 
>     <fo:page-sequence master-reference="first" language="ja">
>         <fo:flow flow-name="xsl-region-body">
>             <fo:block space-before="4mm">
>                 <fo:table font-size="8pt" table-layout="fixed"
> border-collapse="separate"
>                           border-style="solid"
>                           width="2*6mm">
>                     <fo:table-column column-width="6mm"/>
>                     <fo:table-column column-width="6mm"/>
>                     <fo:table-body>
>                         <fo:table-row height="6mm">
>                             <fo:table-cell border-bottom="0.5pt solid
> black" border-right="0.5pt solid black" display-align="center">
>                                 <fo:block-container text-align="center">
>                                     <fo:block>A</fo:block>
>                                 </fo:block-container>
>                             </fo:table-cell>
>                             <fo:table-cell border-bottom="0.5pt solid
> black" border-right="0.5pt solid black">
>                                 <fo:block-container
> reference-orientation="-180" text-align="center" >
>                                     <fo:block>B</fo:block>
>                                 </fo:block-container>
>                             </fo:table-cell>
>                         </fo:table-row>
>                     </fo:table-body>
>                 </fo:table>
>             </fo:block>
>         </fo:flow>
>     </fo:page-sequence>
> </fo:root>
> 
> The key part is the use of reference-orientation:
>            <fo:block-container reference-orientation="-180"
> text-align="center" >
>                     <fo:block>B</fo:block>
>            </fo:block-container>
> 
> The rotation works fine -- the letter B in my example gets rotated.
> But it also gets misplaced: it goes outside it's cell (above the
> cell).
> 
> The PDF rendered by FOP look like this:
> http://fat.bold.cyclop.googlepages.com/upsidedown.pdf (~5k).
> 
> Is it the matter of renderer (Apache FOP 0.93) or it is a behavior
> described by xsl-fo specification? Am I doing something wrong? Maybe
> there is other way in XSL-FO to rotate text?
> 
> 
> Thanks for any help!
> 
> Regards,
> fbc
> 




Jeremias Maerki
Received on Wednesday, 6 February 2008 07:38:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 6 February 2008 07:38:14 GMT