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

RE: vertical centering of a fo:inline

From: Victor Vishnyakov <vvishnyakov@yandex.ru>
Date: Wed, 28 Jul 2004 16:19:09 +0300
To: "'xsl-fo Maillisting'" <www-xsl-fo@w3.org>
Cc: "'Patrick Buchinger'" <patrick@buchinger.net>
Message-ID: <000f01c474a5$78729ea0$2700a8c0@ISLC.local>

Take a look at "7.13.2. alignment-baseline" chapter in the XSL-FO
specification. 
The value "central" or "middle" is might be what you are looking for.

Regards,
Victor Vishnyakov


> -----Original Message-----
> From: www-xsl-fo-request@w3.org 
> [mailto:www-xsl-fo-request@w3.org] On Behalf Of Patrick Buchinger
> Sent: Wednesday, July 28, 2004 2:57 PM
> To: xsl-fo Maillisting
> Subject: vertical centering of a fo:inline
> 
> 
> 
> 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 09:17:59 GMT

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