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

Upside down text in the table

From: fat bold cyclop <fat.bold.cyclop@gmail.com>
Date: Tue, 5 Feb 2008 06:24:51 +0100
Message-ID: <1ee982a50802042124l2c8e270fh3935b32b7437c882@mail.gmail.com>
To: www-xsl-fo@w3.org

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:simple-page-master master-name="first"
page-height="29.7cm" page-width="21cm" margin-top="1cm"
                               margin-bottom="1cm" margin-left="2.5cm"
            <fo:region-body margin-top="1.5cm" margin-bottom="1.5cm"/>

    <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"
                    <fo:table-column column-width="6mm"/>
                    <fo:table-column column-width="6mm"/>
                        <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:table-cell border-bottom="0.5pt solid
black" border-right="0.5pt solid black">
reference-orientation="-180" text-align="center" >

The key part is the use of reference-orientation:
           <fo:block-container reference-orientation="-180"
text-align="center" >

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

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!

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:10:08 UTC