J.Pietschmann wrote:

Mike Trotman wrote:

From my recent experiments, using absolutely positioned block-containers,
I think the image is scaled so that the width is the maximum width of the image
but the height is not constrained (though uniformly scaled).


I don't think so. Have a look at the code in
 ..../fo/flow/ExternalGraphic.java

I'm afraid I've only got a binary version of FOP installed - so no source to look at - and my Java is very elementary.

I'm referring to the width / height of the containing block-container and may not have phrased it clearly.
But the behaviour in FOP seems to be that containing width (not the external-graphic @width) restricts image display size, but height doesn't.
(If this isn't what the previous message was about then I've got hold of the wrong idea and you can ignore the rest of this message.)


I'm basing my comments on the behaviour of this piece of XSL:FO.

37 <fo:static-content flow-name="xsl-region-before">
38 <fo:block-container position="absolute" top="0cm" left="0.0cm" height="20.5cm" width="28cm" border="1px solid silver"/>


39 <fo:block-container position='absolute' top='3cm' left='3cm' height='3in' width='2in' border='3px solid blue'>

40 <fo:block><fo:external-graphic src='url(images/img_2.jpg)' content-height='0.5in' content-width='0.5in'/> </fo:block>
41 <fo:block text-align='right' color='red' background-color='yellow'>XbeforeX</fo:block>


   42 </fo:block-container>
   43 </fo:static-content>

This displays the image inside the block-container while the width on line 39 is < 2.3in (for this particular image).
And as I increase the width upwards to 2.3in the image gets larger and larger
filling the full width of the bock-container but with an ever decreasing gap at the bottom
As soon as the displayed image height exceeds the height of the block-container the image is suppressed.


Unfortunately the height and width attributes are to specify the size of the external-graphic area
which the image is allowed to exceed


Not in the FOP implementation. It may overflow the parent area though.

As you say - in FOP the @height and @width on external-graphic do control the size of the image - and this may exceed the parent area.

But as I read the spec the external-graphic @height sets the height of the box - but the content may exceed this area(?).
I may have got my interpretation of which areas the spec is talking about wrong - although XEP seems to implement them this way.


I've only completely read the spec once or twice and usually only refer back when something is not behaving as I expect (which happens quite often!)

e.g. when I run the above code through XEP the @content-height/width control the size of the image.
If I change these external-graphic attributes to plain @height/width (with no @content-height/width)
then the image (which is large) expands well outside the block and block-container
but the text in line 41 is positioned under a block which has the specified @height of the external-graphic (and across the front of the image).


- which is where content-height and content-width come into play?


I always thought the use case for the content-width|height properties
is for specifying percentages, e.g. content-width="50%" will scale
a 4cm wide image down to a 2 cm wide. This is still tricky for bitmap
images without an embedded resolution.

I'm basing my comments partly on reading the spec. (but not being clear what are the relevant containing areas)
and also on the behaviour of the output in XEP.


@Content-height/width can have % or length values.

% => scale from the image dimensions
<length>=> calculate scale to achieve absolute size (?)

J.Pietschmann

Again - apologies if we're talking at cross-purposes.
I'm no expert at XSLFO - particulalry vague on the behaviour of areas and inherited traits
and have spent quite a bit of time getting myself confused, unconfused and then confused again by the W3C spec. and the behaviour of various formatters.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.18 - Release Date: 19/04/2005


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to