You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Marcus Andersson <ma...@home.se> on 2003/04/04 16:43:39 UTC

Centering a _block_ (read div) of text

Hello

First: Thanx for the help with the questions yesterday.

I need a block of text to be centered. Just to center it is no problem, the problem is that I want one line in one font and the next line in another font and the second line should also be "skewed" relative to the first line. See ascii image:

The whole region-body:
******************************
*         This is the first line                    *
*                   This is the second line     *
*                                                        *
*  etc...                                               *

So I want the complete block of the two lines to be centered. If I create a block element with text-align="center" and in the block element put a block element for each line and also put a start-indent on the second line then the whole block don't get centered. The two lines get centered separatly and then the second lines get an indent from the centered position and that is not the result I want. The result I want can be compared with creating a div-block that is centered in the body and having the first line to the far left in that div and then the second line relative-positioned some pixels to the right. Doing indent on each line with a constant amount isn't an option since I'm generating pdf's from different xml sources (as I guess most people are) and the line lengths can vary.

Hope you understand the question. 

/Marcus

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Centering a _block_ (read div) of text

Posted by Marcus Andersson <ma...@home.se>.
I don't really get how this would help me. I have tried it but the feeling I get is that I need to know the width of the strings to draw in advance and that's exactly what I don't. But I may be wrong. 

If I followed the example in the FAQ then my lines got broken into two (they didn't fit in the 100mm wide cell). Then I tried to adjust the width of the center cell to almost the full document width but then it didn't get centered. 

/Marcus
----- Original Message ----- 
From: "J.Pietschmann" <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Friday, April 04, 2003 11:34 PM
Subject: Re: Centering a _block_ (read div) of text


> Marcus Andersson wrote:
> > So I want the complete block of the two lines to be centered.
> 
> See:
>   http://xml.apache.org/fop/faq.html#fo_center_table_horizon
> 
> J.Pietschmann
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Centering a _block_ (read div) of text

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Marcus Andersson wrote:
> So I want the complete block of the two lines to be centered.

See:
  http://xml.apache.org/fop/faq.html#fo_center_table_horizon

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org