bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#688: Arithmetic error at 'About Emacs' when --with-xft=no


From: Chong Yidong
Subject: bug#688: Arithmetic error at 'About Emacs' when --with-xft=no
Date: Mon, 11 Aug 2008 14:55:54 -0400

> $ ./configure --with-gif=no --with-tiff=no --with-xft=no
> $ make bootstrap
>
> Now it seems I could get rid of antialiasing, but `about-emacs' fails:
> I get "Arithmetic error" after the copyright line drawn:

The arithmetic error was due to a failure of the redisplay engine to
calculate tab widths correctly when the current font's space character
has a width of zero.  I've fixed this, but the issue of why the font has
zero space width remains unsolved.

As a result, the tab widths in `M-x about-emacs' are now zero, which is
an obvious regression from Emacs 22.

The problem at hand is the following code in ftfont_open
(ftfont.c:1077):

    {
      int n;

      font->min_width = font->average_width = font->space_width = 0;
      for (i = 32, n = 0; i < 127; i++)
        if (FT_Load_Char (ft_face, i, FT_LOAD_DEFAULT) != 0)
          {
            int this_width = ft_face->glyph->metrics.horiAdvance >> 6;

            if (this_width > 0
                && (! font->min_width || font->min_width > this_width))
              font->min_width = this_width;
            if (i == 32)
              font->space_width = this_width;
            font->average_width += this_width;
            n++;
          }

      if (n > 0)
        font->average_width /= n;
    }

For some reason, this gives zero.  Handa-san, do you have any insight?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]