Subject: bug#56808: 29.0.50; Elusive display problem on macOS

From: Gerd Möllmann <[email-masked]>
Date: Fri, 29 Jul 2022 16:32:03 +0200

YAMAMOTO Mitsuharu <[email-masked]> writes:

> On Fri, 29 Jul 2022 21:32:49 +0900,
> Gerd Möllmann wrote:
>> 
>> Mabe I should initialize font->space_width to -3.  With -2, it always
>> fails.  ;-).
>
> Does initializing font->space_width to 0 work for you?

Yes it works.  Thanks!

Can we be sure that other uses of space_width don't run into problems?
For instance:

            case MACFONT_SPACING_MONO:
	      if (cache->width_frac)
		bounds.origin.x += - ((cache->width_frac
				       / (CGFloat) (WIDTH_FRAC_SCALE * 2))
				      * (cache->width_int / font->space_width));
              break;

That would be an integer division by 0.  And it's a bit strange because
of the integer division in a float expression...

I know you didn't change that.  I'm just trying to get the maximum out
of having an expert on the line ;-).