- From: G. Ken Holman <gkholman@CraneSoftwrights.com>
- Date: Tue, 24 May 2011 08:38:38 -0400
- To: www-xsl-fo@w3.org
- Message-Id: <7.0.1.0.2.20110524081542.023ace70@wheresmymailserver.com>
At 2011-05-23 17:00 +0200, Giuseppe Briotti wrote: >Hi all, and sorry for this probably trivial question: Not at all trivial. >what I need: >1. a structure (that for semplicity we can call "table") based on 3 >rows and 2 columns (i.e. 2 cells per row) Fine. >2. this structure must be fixed in height (say 20cm) Fine. >3. the rows must have a preferable height of 30%, 40%, 30% as >optimum but must be able to change the height accordingly with the cell content Not fine ... there are no semantics in XSL-FO 1.1 for the juggling of heights as you request. >Assuming that probably I have some problem with tables :-) I try a >"only block containers solution": I did the same in order to illustrate for you how XSL-FO 1.1 handles the .minimum, .optimum and .maximum component properties. >1. Any hint? I can't help you with FOP as I don't use it. Attached is a PDF example (FO below) created using Antenna House. >2. What I'm missing? There is no vertical justification in XSL-FO 1.1, this you cannot stretch vertical content to be anything at all ... it is what it is. >3. There is another way? If I understand your requirement, not in XSL-FO 1.1. >4. There is a way to extimate the height required, assuming that I >know the text lenght and font parameters, in order to >programmaticaly set the row height? No. There is no feedback loop in XSL-FO 1.1 for the formatter to tell your transformation how much space any given construct will take. Everything must be specified by you using contingencies in the available semantics of XSL-FO. In the example below I show the .minimum, .optimum and .maximum properties in play. Where justification is available (horizontally) you can see the dot leader start at optimum, shrink towards minimum and expand no bigger than maximum. Where justification is not available (vertically) you can see the minimum and maximum in play in the vertical dimension of the block container. Here the .optimum is only used by the nested block container that determines its height (which is 100% of the outer block container) is the outer block container's optimum height. I hope this helps you understand what is going on. . . . . . . . . . . Ken <?xml version="1.0" encoding="US-ASCII"?><!--minmaxopt.fo--> <root xmlns="http://www.w3.org/1999/XSL/Format" font-family="Times" font-size="20pt"> <layout-master-set> <simple-page-master master-name="frame" page-height="297mm" page-width="210mm" margin-top="15mm" margin-bottom="15mm" margin-left="15mm" margin-right="15mm"> <region-body region-name="frame-body"/> </simple-page-master> </layout-master-set> <page-sequence master-reference="frame"> <flow flow-name="frame-body" xmlns="http://www.w3.org/1999/XSL/Format"> <block> 20mm leader: <leader leader-pattern="dots" leader-length="20mm"/> </block> <block> 75mm leader: <leader leader-pattern="dots" leader-length="75mm"/> </block> <block> 125mm leader: <leader leader-pattern="dots" leader-length="125mm"/> </block> <block> This is a test with a leader <leader leader-pattern="dots" leader-length.minimum="20mm" leader-length.optimum="75mm" leader-length.maximum="125mm"/> </block> <block> This is a test with a leader <leader leader-pattern="dots" leader-length.minimum="20mm" leader-length.optimum="75mm" leader-length.maximum="125mm"/> followed by text. </block> <block> This is a test with a leader <leader leader-pattern="dots" leader-length.minimum="20mm" leader-length.optimum="75mm" leader-length.maximum="125mm"/> followed by more text. </block> <block> This is a test with a leader <leader leader-pattern="dots" leader-length.minimum="20mm" leader-length.optimum="75mm" leader-length.maximum="125mm"/> followed by yet more text. </block> <block> This is a test with a leader <leader leader-pattern="dots" leader-length.minimum="20mm" leader-length.optimum="75mm" leader-length.maximum="125mm"/> followed by enough text to cause a wrap of the line. </block> <block text-align-last="justify"> Justified: <leader leader-pattern="dots" leader-length.minimum="20mm" leader-length.optimum="75mm" leader-length.maximum="125mm"/> </block> <block-container block-progression-dimension="20mm" border="solid"> <block>20mm high</block> </block-container> <block-container block-progression-dimension="40mm" border="solid"> <block>40mm high</block> </block-container> <block-container block-progression-dimension="60mm" border="solid"> <block>60mm high</block> </block-container> <block break-after="page"/> <block-container block-progression-dimension.minimum="20mm" block-progression-dimension.optimum="40mm" block-progression-dimension.maximum="60mm" border="solid"> <block-container absolute-position="absolute" border="dotted" bottom="0pt" right="0pt" left="125mm" display-align="after"> <block>Float</block> </block-container> <block>20/40/60mm</block> </block-container> <block>===============</block> <block-container block-progression-dimension.minimum="20mm" block-progression-dimension.optimum="40mm" block-progression-dimension.maximum="60mm" border="solid"> <block-container absolute-position="absolute" border="dotted" bottom="0pt" right="0pt" left="125mm" display-align="after"> <block>Float</block> </block-container> <block>20/40/60mm</block> <block>test2</block> <block>test2</block> <block>test2</block> <block>test2</block> </block-container> <block>===============</block> <block-container block-progression-dimension.minimum="20mm" block-progression-dimension.optimum="40mm" block-progression-dimension.maximum="60mm" border="solid"> <block-container absolute-position="absolute" border="dotted" bottom="0pt" right="0pt" left="125mm" display-align="after"> <block>Float</block> </block-container> <block>20/40/60mm</block> <block>test3</block> <block>test3</block> <block>test3</block> <block>test3</block> <block>test3</block> <block>test3</block> <block>test3</block> <block>test3</block> <block>test3</block> </block-container> <block>===============</block> </flow> </page-sequence> </root>
-- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/ G. Ken Holman mailto:gkholman@CraneSoftwrights.com Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Attachments
- application/pdf attachment: minmaxopt.pdf
Received on Tuesday, 24 May 2011 12:40:32 UTC