On Thu, Apr 27, 2000 at 06:10:24PM -0400, Alexander N. Kabaev wrote:
> How to reproduce:
> 
> I do not have small code snippet to demonstrate the bug, but interested people
> can easily enough reproduce this bug by compiling 'plan' program and putting 
> Plan*fontList: -*-arial-medium-r-normal-*-*-140-*-*-*-*-iso8859-1 in .Xdefaults
> 
> Why Lesstif dumps core:
> 
> Function FontInit contains the following code in two places:
> 
>        Out_FontAverageWidth(o) =
>             (fs->max_bounds.width + fs->min_bounds.width) / 2;
> 
> TrueType backend (XFree86 4.0, xfsft module) returns XFontStruct which has 
> min_bounds.width = -max_bounds.width, thus FontInit will set average character
> width for TrueType fonts to 0. Later in the same file in function
> _XmTextOutputCreate, Lesstif tries to estimate the number of visible characters
> using the following code at line 2476:
> 
>      Out_Columns(o) = (XtWidth(w) - ( Out_LeftMargin(o) + Out_RightMargin(o))
>                 ) / Out_FontAverageWidth(o);
> Obviously, the code fails with divide-by-zero error.

I'm no expert here, but somehow I would have expected that
both widths have the same sign - doesn't this specify the
direction of the font writing?
Is the first formula correct, even with a few signs conditionally
being changed!?

-- 
Alexander Mai
[EMAIL PROTECTED]

Reply via email to