xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Art Welch <ar...@EASTPOINT.COM>
Subject FW: halfLeading calculation problem
Date Mon, 18 Dec 2000 20:07:27 GMT
I just read section 4.6 "Line-areas" of the XSL Spec (a couple of times
actually). I do not quite follow it, but it seems to me that FOP does not
support the line-stacking-strategy and BlockArea thinks that it is using
"line-height" and LineArea thinks that it is "font-height". Or something
like that... Maybe if I read it a few more times it will make sense...

Anyhow it does appear that in general the font ascent + descent would not be
equal to the font height (assuming that these are the "nominal" values). So
if this is correct then I think that we need to change the height

If FOP does not support line-stacking-strategy, I think that it should
choose one strategy.

Thank You,
Art (re-reading again)

-----Original Message-----
From: Art Welch 
Sent: Monday, December 18, 2000 2:31 PM
To: 'fop-dev@xml.apache.org'
Subject: FW: halfLeading calculation problem

I am resending this, because I do not recall seeing it on the list and have
not received any replies.

Can someone lend some insight on this.

Thank You,

>  -----Original Message-----
> From: 	Art Welch  
> Sent:	Friday, December 15, 2000 6:00 PM
> To:	'fop-dev@xml.apache.org'
> Subject:	halfLeading calculation problem
> I noticed a problem where setting the line-height attribute on a block did
> not result in lines being produced with the specified height. For example
> setting a line-height="0.17in" was resulting in lines of approximately
> 0.15in. I believe that I know why this is happening. In
> BlockArea.BlockArea() the half leading is set as follows:
> 	  this.halfLeading = (lineHeight - fontState.getFontSize())/2;
> This is then used in BlockArea.addLineArea() as follows:
>     public void addLineArea(LineArea la) {
> 	if (!la.isEmpty()) {
> 	    this.addDisplaySpace(this.halfLeading);
> 	    int size = la.getHeight();
> 	    this.addChild(la);
> 	    this.increaseHeight(size);
> 	    this.addDisplaySpace(this.halfLeading);
> 	}
>     }
> I think that the idea hear is that the LineArea would have height equal to
> the font size. If this were the case then halfLeading + la.getHeight() +
> halfLeading would indeed add up to lineHeight. Unfortunately
> LineArea.getHeight() is coded as follows:
>     public int getHeight() {
> 	return this.allocationHeight;
>     }
> and the allocationHeight is set in the constructor by the following code:
> 	this.nominalGlyphHeight = fontState.getAscender() -
> 	    fontState.getDescender(); 
> 	...
> 	this.allocationHeight = this.nominalGlyphHeight;
> So we see that the LineArea will return the font Ascender - Descender for
> the Height. Using Courier (7pt) I have the following values:
> 	Font Size	7048
> 	Ascender	4433
> 	Descender	-1106
> These yield Ascender - Descender = 5539 which is of course not equal to
> the Font Size of 7048.
> Assuming that there is not another problem, like the Ascender or
> Descender, or Font Size being calculated incorrectly, I submit that one of
> the height calculations must be incorrect. Can we fix this? Does anyone
> know which one (if either) is correct? My guess would be LineArea is
> correct, but I would need to do a bit more research to be certain.
> Thank You,
> Art

View raw message