On Jun 24, 2008, at 09:12, JonathanHeard wrote:
Hi
Apologies for the late reply
<snip />
I would very much like to be able to put a rounded rectangle box
(or other
SVG frame) around blocks of text with varying size. I know that using
'background-image' has no support for scaling (unless I could
afford XEP
which appears to have an extension for this) - So I then though I
was on to
a winner by using the following:
40 <fo:block-container>
41 <fo:block-container absolute-position="absolute"
height="auto"
width="auto" border="1px solid blue">
42 <fo:block border="2px solid green">
43 <fo:external-graphic src="url("box3.svg")"
overflow="hidden" border="1px dashed black" content-height="
scale-to-fit" width="100%" height="100%" content-width="scale-to-fit"
scaling="non-uniform" />
44 </fo:block>
45 </fo:block-container>
46
47 <fo:block border="3px solid yellow">
48 <xsl:apply-templates select="title"/>
49 <xsl:apply-templates select="duration"/>
50 <xsl:apply-templates select="coursedesc"/>
51 </fo:block>
52
53 </fo:block-container>
Bear in mind that I've been messing around a lot with the various
properties
of each object, so my choices may not appear completely sane. Also the
'border' properties are there purely for me to see and debug the
layout.
What I'm finding is that the blocks inserted by the templates 'title',
'duration' and 'coursedesc' force the block on line 47 to grow to
the size
of the text, but because the block-container at line 41 is positioned
absolutely to allow it to sit behind the text content, it has no
way of
basing its size on the quantity of text.
One to achieve this, could be to use:
- one normal block-container (no absolute-position) to contain the whole
- one nested normal block-container with borders, surrounding the
produced block
- four absolutely positioned block-containers containing the rounded
corners
Both surrounding block-container's heights will grow to fit the block.
If the four block-containers for the corners then, are children of
the first block-container (siblings to the b-c containing the block),
their positions will be 'absolute' in that block-container, and you
should be able to do something like:
<fo:block-container absolute-position="absolute" top="0" left="0">
...
<fo:block-container absolute-position="absolute" top="0" left="100%">
...
<fo:block-container absolute-position="absolute" top="100%" left="0">
...
<fo:block-container absolute-position="absolute" top="100%" left="100%">
This is roughly the idea. It will obviously still take some fiddling
with those values to get the corners to align correctly with the
borders of the block-container and overpaint the regular corners, but
it definitely seems worth a shot.
HTH!
Cheers
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]