Apache OpenOffice (AOO) Bugzilla – Issue 73811
External Leading is incorrectly calculated
Last modified: 2007-01-31 16:02:51 UTC
One more problem related with vcl/source/glyphs/gcach_ftyp.cxx. I noticed the following piece of code: if( pHHEA != NULL ) { // extleading formula from www.microsoft.com/typography/otspec/recom.htm int nExtLeading = pHHEA->Line_Gap; nExtLeading -= (pOS2->usWinAscent + pOS2->usWinDescent); nExtLeading -= (pHHEA->Ascender - pHHEA->Descender); if( nExtLeading > 0 ) rTo.mnExtLeading = (long)(nExtLeading * fScale + 0.5); } Frankly speaking, I don't understand how this code may correspond to the referenced page of specification, which actually recommends the following formula for calculating external leading: MAX(0, LineGap - ((usWinAscent + usWinDescent) - (Ascender - Descender))) As far as I can see, the problem lies in the extra pair of parentheseis: the specification recommends to subtract the difference of (usWinAscent + usWinAscent) and (Ascender - Descender) from LineGap, while in the current code both these values are subtracted sequentially. Such method of calculation seems to make no sense, as it will almost certainly result into a negative value, thus making the whole piece of code unusable.
Yes, see http://gsl.openoffice.org/source/browse/gsl/vcl/source/glyphs/gcach_ftyp.cxx?r1=1.133&r2=1.134 for the fix. It is in development releases >=SRC680_m193 and will be in OOo 2.2. *** This issue has been marked as a duplicate of 60945 ***
Closing duplicate issue.