[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    [xsl] FO: Scaling and centering content in remaining space
From:       "=?UTF-8?B?TWljaGFlbCBNw7xsbGVyLUhpbGxlYnJhbmQgbW1oQGRvY3VmeS5kZQ==?=" <xsl-list
Date:       2014-10-24 9:53:27
Message-ID: 20141024055244.16530 () lists ! mulberrytech ! com
[Download RAW message or body]

Hello experts,

a given area of a fixed size has two blocks of content. At the top a region with \
background color has a minimum height which may grow if text content is longer.

In the remaining space below it (whose height is unknown) a graphic shall be \
positioned with a number of requirements:

* it should be scaled to the available space, either horizontally or vertically, \
whatever limit is reached first, I achieved this using min-width and min-height set \
                to "100%",
* if limited by max-height it should be centered horizontally, this is easily done \
                using text-align="center",
* if limited by max-width it should be centered vertically, which I finally achieved \
using the spacing attributes shown below.

But it looks not very elegant (to me, that is). Are there better methods to scale and \
distribute content in the unknown available space? An answer naming the concept to \
look at would be greatly appreciated.

Thanks,

- Michael Müller-Hillebrand


<fo:block-container position="fixed" top="44mm" height="202mm">
 <fo:block-container background-color="blue" min-height="70mm" padding-bottom="5mm">
  <fo:block>Text</fo:block>
  <fo:block>Text</fo:block>
  <fo:block>Text</fo:block>
 </fo:block-container>
 <fo:block text-align="center"
     space-before.minimum="1mm" space-before.maximum="40mm" \
space-before.optimum="10mm"   space-before.conditionality="retain"
     space-after.minimum="1mm" space-after.maximum="40mm" space-after.optimum="10mm"
     space-after.conditionality="retain">
  <fo:external-graphic src="image.png" 
     min-height="100%" max-height="100%" 
     min-width="100%" max-width="100%" />
 </fo:block>
</fo:block-container>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/651070
or by email: xsl-list-unsub@lists.mulberrytech.com
--~--


["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlRKIV8ACgkQvRHp/xgNIQ9QrgCg6OFPI4qulU0z5kguCkI+8CMB
ZcAAoJcKeSDcMrd8MmwuRlIdWj2ZSGwo
=Hncv
-----END PGP SIGNATURE-----


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic