Upside down text in the table

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

Received on Wednesday, 6 February 2008 06:25:40 UTC