unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 43177@debbugs.gnu.org, schwab@linux-m68k.org,
	emacs@Alexander.Shukaev.name
Subject: 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	[thread overview]
Message-ID: <m28sdpzo7j.fsf@gmail.com> (raw)
In-Reply-To: <83mu25u3x9.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Sep 2020 15:22:58 +0300")

>>>>> On Fri, 04 Sep 2020 15:22:58 +0300, Eli Zaretskii <eliz@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 ();







  reply	other threads:[~2020-09-04 13:05 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03  7:18 bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1' Alexander Shukaev
2020-09-03  7:28 ` Robert Pluim
2020-09-03  7:42   ` Pip Cet
2020-09-03  8:50     ` Alexander Shukaev
2020-09-03  8:51   ` Alexander Shukaev
2020-09-03  9:02     ` Alexander Shukaev
2020-09-03  9:07       ` Robert Pluim
2020-09-03  9:40         ` Alexander Shukaev
2020-09-03  9:50           ` Alexander Shukaev
2020-09-03  9:53             ` Alexander Shukaev
2020-09-03 10:06               ` Robert Pluim
2020-09-03 10:24                 ` Alexander Shukaev
2020-09-03 12:13                   ` Robert Pluim
2020-09-03 12:28                     ` Alexander Shukaev
2020-09-03 12:43                       ` Robert Pluim
2020-09-03 12:52                         ` Andreas Schwab
2020-09-03 13:19                           ` Robert Pluim
2020-09-03 13:28                             ` Andreas Schwab
2020-09-03 14:21                               ` Robert Pluim
2020-09-03 14:48                                 ` Andreas Schwab
2020-09-03 15:10                                   ` Robert Pluim
2020-09-03 16:39                                     ` Alexander Shukaev
2020-09-03 19:47                                       ` Alexander Shukaev
2020-09-04  6:54                                         ` Eli Zaretskii
2020-09-03 17:37                                     ` Eli Zaretskii
2020-09-03 17:51                                       ` Andreas Schwab
2020-09-03 18:24                                         ` Eli Zaretskii
2020-09-04  7:45                                           ` Robert Pluim
2020-09-04 12:22                                             ` Eli Zaretskii
2020-09-04 13:05                                               ` Robert Pluim [this message]
2020-09-04 13:30                                                 ` Eli Zaretskii
2020-09-04 14:04                                                   ` Robert Pluim
2020-09-04 17:26                                                     ` Eli Zaretskii
2020-09-07 14:18                                                       ` Robert Pluim
2020-09-07 14:41                                                         ` Pip Cet
2020-09-07 14:48                                                           ` Robert Pluim
2020-09-07 14:49                                                         ` Eli Zaretskii
2020-09-07 15:06                                                           ` Robert Pluim
2020-09-15 15:40                                                             ` Robert Pluim
2020-09-03  9:58           ` Robert Pluim
2020-09-03 13:19             ` Eli Zaretskii
2020-09-03 14:03               ` Robert Pluim
     [not found] ` <handler.43177.B.159911754532334.ack@debbugs.gnu.org>
2020-09-03  7:30   ` bug#43177: Acknowledgement (Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1') Alexander Shukaev
2020-09-03  8:43   ` Alexander Shukaev

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=m28sdpzo7j.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=43177@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs@Alexander.Shukaev.name \
    --cc=schwab@linux-m68k.org \
    /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).