W3C home > Mailing lists > Public > www-xsl-fo@w3.org > July 2004

vertical centering of a fo:inline

From: Patrick Buchinger <patrick@buchinger.net>
Date: Wed, 28 Jul 2004 13:57:10 +0200
To: xsl-fo Maillisting <www-xsl-fo@w3.org>
Message-Id: <1091015830.30917.18.camel@dumpfbacke.linz1.at>

hello!

i want to do the following:

i need one textline with different font-families and/or font-sizes. i
managed this problem with using fo:inline elements within a fo:block.

now i need to vertically center all fo:inline elements. so, for example,
i have the text "big letters" with font-size="2.0mm" directly followed
by the text "small letters" with font-size="1.0mm". i need the text
"small letters" to appear vertically centered.

i tried this

<snip>

<fo:block-container position="absolute" left="7.0mm" top="34.5mm"
width="70mm" height="55mm">
  <fo:block>
    <fo:inline font-size="2.0mm">
      big letters
    </fo:inline>
    <fo:inline vertical-align="center" font-size="1.0mm">
      small letters
    </fo:inline>
  </fo:block>
</fo:block-container>

</snip>

but the text "small letters" always appears at the baseline.


when i'm using a table, the text would be vertically centered, but i
have troubles with the column-width since i don't know the text which
has to be printed. it was impossible for me to create table-cells which
exactly have the text's width (remember, i need the different texts
directly one after another).

here is the code i tried:

<snip>
  <fo:block-container position="absolute" left="7.0mm" top="32.0mm"
width="70mm" height="55mm">
      <fo:table table-layout="auto" width="100%">
        <fo:table-column/>
        <fo:table-column/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell display-align="center">
              <fo:block font-size="2.0mm">
                big letters
              </fo:block>
            </fo:table-cell>
            <fo:table-cell display-align="center">
              <fo:block font-size="1.0mm">
                small letters
              </fo:block>
            </fo:table-cell>
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
  </fo:block-container>

</snip>

this code gives me two table-cells, each 50% width.



can someone help me?


thank you,

patrick
Received on Wednesday, 28 July 2004 08:15:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:12 GMT