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 Richard Evans <ri...@retek.com> on 2004/06/30 21:23:29 UTC

Auto-sized block?

I want to have a block of text with a border and background colour which is
just wide enough for the text.

 

I've tried fo:block with border and background-color attributes but the
block always seems to extend across the whole page.

 

Any simple solution?

 

Richard


Re: Auto-sized block?

Posted by Chris Bowditch <bo...@hotmail.com>.
Richard Evans wrote:

> I want to have a block of text with a border and background colour which 
> is just wide enough for the text.
> 
>  
> 
> I’ve tried fo:block with border and background-color attributes but the 
> block always seems to extend across the whole page.

You need to use fo:inline or fo:inline-container for what you want. 
Unfortunately these elements have not been implemented properly, i.e. border 
and background color do not apply, and fo:inline is functionally the same as 
fo:wrapper.

Chris



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


Re: Auto-sized block?

Posted by Adam Augusta <ro...@WPI.EDU>.
On Wed, 30 Jun 2004, Richard Evans wrote:

> I want to have a block of text with a border and background colour which is
> just wide enough for the text.

The only solution I can think of involves having either a transform or 
simple program run through the XML font metric file and assess the width + 
kerning of your text to come up with an appropriate width for your block 
container.

-Adam



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