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


View this message in rfc822 format

From: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>
To: Robert Pluim <rpluim <at> gmail.com>, Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 43177 <at> debbugs.gnu.org
Subject: bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'
Date: Thu, 3 Sep 2020 21:47:41 +0200
On 03/09/2020 18:39, Alexander Shukaev wrote:
> On 03/09/2020 17:10, Robert Pluim wrote:
>>>>>>> On Thu, 03 Sep 2020 16:48:04 +0200, Andreas Schwab 
>>>>>>> <schwab <at> linux-m68k.org> said:
>>
>>      Andreas> On Sep 03 2020, Robert Pluim wrote:
>>      >> Does it go away if you set font-backend . ftcrhb in your frame
>>      >> parameters (assuming youʼre using Cairo)?
>>
>>      Andreas> That completely removes the delay.
>>
>> So the solution is easy: just deprecate and remove the 'x' backend :-)
>>
>> Robert
>>
> 
> Love that tip, man!  Confirming the speed up.  Thanks a lot!

For future visitors and for completeness sake, my per-frame font setup 
function now looks like this:

  (defun init-frame-font-setup
      (&optional frame)
    (unless frame (setq frame (selected-frame)))
    (with-selected-frame frame
      (when (and (not noninteractive) (init-display-graphic-p))
        (let ((font-backend (assoc 'font-backend default-frame-alist)))
          (if font-backend
              (when (eq frame frame-initial-frame)
                (modify-frame-parameters frame
                                         `((font-backend . ,font-backend)))
                (unless noninteractive
                  (message "Font Backend: `%s'" font-backend)))
            (when (and (> emacs-major-version 26)
                       (boundp 'cairo-version-string))
              (setq font-backend "ftcrhb"))
            (when font-backend
              (add-to-list 'default-frame-alist
                           `(font-backend . ,font-backend))
              (modify-frame-parameters frame
                                       `((font-backend . ,font-backend)))
              (unless noninteractive
                (message "Font Backend: `%s'" font-backend)))))
        (let ((font (assoc 'font default-frame-alist)))
          (if font
              (when (eq frame frame-initial-frame)
                (set-frame-font font t t)
                (unless noninteractive
                  (message "Font: `%s'" font)))
            (let ((font-family (catch 'break
                                 (dolist (font-family init-font-families)
                                   (when (member font-family
                                                 (font-family-list))
                                     (throw 'break font-family))))))
              (setq font (when font-family
                           (format "%s-%d" font-family init-font-size))))
            (when font
              (add-to-list 'default-frame-alist `(font . ,font))
              (set-frame-font font t t)
              (unless noninteractive
                (message "Font: `%s'" font))))))))

Typical usage is to add the following stanza to Emacs Lisp 
initialization file(s):


  (unless (or noninteractive (daemonp))
    (when (init-display-graphic-p)
      (init-frame-font-setup)))

  (dolist (hook '(after-make-frame-functions focus-in-hook))
    (add-hook hook #'init-frame-font-setup))




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

Previous Next


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