xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Mall ...@arcus.com.au>
Subject RE: Line-height inheritance
Date Wed, 09 Apr 2008 07:50:55 GMT
The mysteries of the XSL-FO specification are dazzling us gain. In 5.1.4 it
says:

"In most cases, elements inherit computed values. However, there are some
properties whose specified value may be inherited (e.g., some values for the
"line-height" property). In the cases where child elements do not inherit
the computed value, this is described in the property definition."

Under 7.15.4 "line-height" the above mentioned exception to the rule of
computed values being inherited is specified for <number> where it says:
"However, the number, not the computed value, is inherited."

But this inheritance exception does not apply to <percentage> or <length>
specifications. However, it does apply to 'normal' as it says the value has
the same meaning as <number>.

So my understanding of this is that

<fo:block font-size="12pt" line-height="1.2">
     <fo:block font-size="8pt">

is identical to

<fo:block font-size="12pt" line-height="1.2">
     <fo:block font-size="8pt" line-height="1.2">

But

<fo:block font-size="12pt" line-height="120%">
     <fo:block font-size="8pt">

means

<fo:block font-size="12pt" line-height="120%">
     <fo:block font-size="8pt" line-height="14.4pt">

I believe the exceptional inheritance behaviour of 'normal' and <number> is
simply done so that the initial value which is 'normal' behaves
appropriately otherwise in the absence of any line-height specifications all
lines would have a fixed line-height based on the initial font-size.

BTW, all of this is unchanged in XSL-FO 1.1.

Manuel

> -----Original Message-----
> From: Pascal Sancho [mailto:pascal.sancho@takoma.fr]
> Sent: Wednesday, 9 April 2008 3:03 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: RE: Line-height inheritance
> 
> Hi Andrea,
> 
> > -----Message d'origine-----
> > De : Andreas Delmelle [mailto:andreas.delmelle@telenet.be]
> > Envoyé : mardi 8 avril 2008 23:36
> >
> > On Apr 8, 2008, at 15:20, Pascal Sancho wrote:
> >
> >
> > Hi Pascal,
> >
> > > Reading the spec 7.16.4, line-height property is inherited
> > and accepts
> > > percentages values.
> > > FOP behaves as follow:
> > > If the line-height value is a percentage, the inherited value is the
> > > computed trait: font-size*line-height(in %)
> > > I'm not sure if FOP behaviour is correct. I was expecting the
> > > percentage
> > > value for the inheried line-height.
> > > Am I wrong?
> >
> > FOP's behavior is correct, I think.
> >
> > 5.1.4 Inheritance
> >
> > ... For a given inheritable property, if that property is present on
> > a child, ... otherwise, the specified value of that property on the
> > child is the /computed/ value of that property on the parent
> > formatting object.
> >
> >
> > In other words, if you have:
> >
> > <fo:block font-size="12pt" line-height="120%">
> >    <fo:block font-size="8pt">
> >
> > Then the specified line-height for the inner block would be "12pt x
> > 120%", and not, if I interpret your question correctly, "8pt x 120%".
> >
> > Cheers
> > Andreas
> 
> IIUC, the following snippet should be interpreted as you said above about
> percentage.
> The 2nd fo:block line-height should be 12*1.2
> 
> <fo:block font-size="12pt" line-height="1.2">
>     <fo:block font-size="8pt">
> 
> IMHO, behaviour should be the same for either percentage or numeric value.
> IIUC your point of view, in both cases, according to the spec, inherited
> line-height should be computed value.
> 
> What I expect, is that inherited line-height should remain relative when
> possible.
> (What about line-height expressed in 'em'?)
> 
> WDYT?
> 
> Pascal
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message