GNU bug report logs - #43177
Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

Previous Next

Package: emacs;

Reported by: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>

Date: Thu, 3 Sep 2020 07:20:02 UTC

Severity: normal

Fixed in version 28.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #107 received at 43177 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 43177 <at> debbugs.gnu.org, schwab <at> linux-m68k.org, emacs <at> Alexander.Shukaev.name
Subject: Re: bug#43177: Bug: Emacs 27.1 hangs forever in
 `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'
Date: Fri, 04 Sep 2020 15:05:52 +0200
>>>>> On Fri, 04 Sep 2020 15:22:58 +0300, Eli Zaretskii <eliz <at> gnu.org> said:
    Eli> I don't think this would help, because most scripts don't specify
    Eli> language properties like 'ja' or 'ko', which is what
    Eli> xfont_supported_scripts uses.

ok

    >> Perhaps we should flip the default of scalable-fonts-allowed to nil
    >> under GNU/Linux? [1]
    >> (unless the only available font-backend is 'x', which can only happen
    >> if the user explicitly sets it that way)?

    Eli> That'd be backward-incompatible.  Besides, I think it's too late.  I
    Eli> think we should do this in font.c, where the 'list' method of each
    Eli> font backend is called.  There, we should not call the 'x' backend
    Eli> unless the no fonts were found by the backend called before it.  This
    Eli> should be controlled by a variable exposed to Lisp, of course.

    Eli> Does that make sense?

Yes. Something like the following works, and makes displaying
etc/HELLO quite a bit faster.

diff --git a/src/font.c b/src/font.c
index 2786a772dc..6bff3a7362 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2810,7 +2810,13 @@ font_list_entities (struct frame *f, Lisp_Object spec)
 		|| ! NILP (Vface_ignored_fonts)))
 	  val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
 	if (ASIZE (val) > 0)
-	  list = Fcons (val, list);
+          {
+            list = Fcons (val, list);
+            /* Querying further backends can be very slow, so we only do
+               it if the user has explicitly requested it (Bug#43177).  */
+            if (query_all_font_backends == false)
+              break;
+          }
       }
 
   list = Fnreverse (list);
@@ -5527,6 +5533,13 @@ syms_of_font (void)
 cause Xft crashes.  Only has an effect in Xft builds.  */);
   xft_ignore_color_fonts = true;
 
+  DEFVAR_BOOL ("query-all-font-backends", query_all_font_backends,
+               doc: /*
+Non-nil means attempt to query all available font backends when
+looking up a font, otherwise stop as soon as a suitable font has been
+found.  */);
+  query_all_font_backends = false;
+
 #ifdef HAVE_WINDOW_SYSTEM
 #ifdef HAVE_FREETYPE
   syms_of_ftfont ();






This bug report was last modified 4 years and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.