unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Kenichi Handa  <handa@m17n.org>
Cc: Peter Tury <tury.peter@gmail.com>, 688@emacsbugs.donarmstrong.com
Subject: bug#688: Arithmetic error at 'About Emacs' when --with-xft=no
Date: Mon, 11 Aug 2008 14:55:54 -0400	[thread overview]
Message-ID: <87r68vfkjp.fsf@stupidchicken.com> (raw)

> $ ./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	other threads:[~2008-08-11 18:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 18:55 Chong Yidong [this message]
2008-08-11 21:02 ` bug#688: Arithmetic error at 'About Emacs' when --with-xft=no Peter Tury
2008-08-11 21:04 ` Peter Tury
2008-08-11 21:05 ` Peter Tury
2008-09-03 20:23   ` Peter Tury
     [not found] <b5accf970808101354x3921689dnc204016d563ebd4f@mail.gmail.com>
2008-08-10 21:00 ` Peter Tury
2008-08-11  1:05   ` OFFICE ZERO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r68vfkjp.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=688@emacsbugs.donarmstrong.com \
    --cc=handa@m17n.org \
    --cc=tury.peter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).