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 "J.Pietschmann" <j3...@yahoo.de> on 2002/07/08 21:06:09 UTC

Re: Just what is proportional-column-width() ?

Richard Bondi wrote:
> The definition from the spec is (at least to me) almost completely 
> opaque. Here's the original defition, followed by my interpretation of it.
> 
>     * Function: */numeric/ *proportional-column-width*( /numeric/) The
>     proportional-column-width function returns /proportional factor/
>     (the argument) units of proportional measure. The column widths are
>     first determined ignoring the proportional measures. The difference
>     between the table-width and the sum of the column widths is the
>     available proportional width. One unit of proportional measure is
>     the available proportional width divided by the sum of the
>     proportional factors. It is an error to use this function on
>     formatting objects other than an fo:table-column. It is also an
>     error to use this function if the fixed table layout is not used.
> 

My interpretation is:
  1. Evaluate each column width with proportional-column-width() set
     to zero.
  2. Subtract the sum of 1. from the table width.
  3. Divide the result of 2. by the sum of all arguments of the
     proportional-column-width() functions. The result is the proportional
     width.
  4. Evaluate the column widths again, this time
     proportional-column-width(X) returning X times the proportional
     width
This means:
- a table with
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="proportional-column-width(1)"/>
   has two columns of equal width.
- a table with
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="proportional-column-width(2)"/>
   has two columns, the second twice as wide as the first.
- a table with
   <fo:table width="100mm">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm"/>
     <fo:table-column column-width="proportional-column-width(2)"/>
   has columns of 20mm, 40mm and 40mm width
- a table with
   <fo:table width="100%">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm"/>
     <fo:table-column column-width="proportional-column-width(1)"/>
   has a the second column of 40mm width and rest width equally distributed
   between the first and the third row.
- a table with
   <fo:table width="100mm">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm+proportional-column-width(1)"/>
   hastwo columns of 30mm and 70mm width.

> To sum up: none of the main terms in this definition are ever defined. 
> It really ought to be rewritten.

This happens.

HTH
J.Pietschmann