Subject: Re: 23.0.60; Emacs trying too hard to find fonts that don't exist

From: Chong Yidong <[email-masked]>
Date: Fri, 23 Jan 2009 00:04:09 -0500

> If fonts are not installed for some characters, then Emacs keeps
> trying to find fonts for them every time those characters are
> redisplayed. The following excerpt from font-log is with the xft font
> backend on GNU/Linux where the search is quick, thus not noticeable,
> but on Windows the search for fonts is expensive, so redisplay takes a
> couple of seconds. I have cut the end off, as the full font-log is
> long, but you can see from the first two font-for entries that Emacs
> is trying twice for the same character (and it tries again many times
> further down the log).

At the end of fontset_font (fontset.c:699), there is the following code:

  /* Remeber that we have no font for C.  */
  FONTSET_SET (fontset, make_number (c), Qt);

  return Qnil;

However, there are several other places in that function that return
with a Qnil, without doing this FONTSET_SET.  Do matters improve if we
do the same FONTSET_SET call before returning?