From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#26402: 25.2; Font rendering extremely slow on any non-default font Date: Sat, 08 Apr 2017 20:18:15 +0300 Message-ID: <83bms6n7hk.fsf@gnu.org> References: <588df69e-068d-e2c5-3c2f-3ca238313aa9@gmail.com> <83inmfm00v.fsf@gnu.org> <04e03d3a-62f1-82f2-b7a8-9e36cf5e826b@gmail.com> <83h91ynam6.fsf@gnu.org> <541302bf-540b-aedb-4ca4-2ba3acfe495e@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1491671958 2523 195.159.176.226 (8 Apr 2017 17:19:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Apr 2017 17:19:18 +0000 (UTC) Cc: 26402@debbugs.gnu.org To: Gennady Uraltsev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 08 19:19:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwu0y-0007sP-Bp for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 19:19:08 +0200 Original-Received: from localhost ([::1]:56019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwu14-0004z3-9F for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 13:19:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwu0y-0004ym-PP for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 13:19:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwu0s-00015S-Lv for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 13:19:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40194) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwu0s-00015M-Im for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 13:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cwu0s-0006Hn-B2 for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 13:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Apr 2017 17:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26402-submit@debbugs.gnu.org id=B26402.149167191924132 (code B ref 26402); Sat, 08 Apr 2017 17:19:02 +0000 Original-Received: (at 26402) by debbugs.gnu.org; 8 Apr 2017 17:18:39 +0000 Original-Received: from localhost ([127.0.0.1]:38393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwu0V-0006HA-Fm for submit@debbugs.gnu.org; Sat, 08 Apr 2017 13:18:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwu0T-0006Gx-Uo for 26402@debbugs.gnu.org; Sat, 08 Apr 2017 13:18:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwu0J-0000i1-Nt for 26402@debbugs.gnu.org; Sat, 08 Apr 2017 13:18:32 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwu0J-0000hw-KA; Sat, 08 Apr 2017 13:18:27 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2674 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cwu0F-0006iY-Ml; Sat, 08 Apr 2017 13:18:27 -0400 In-reply-to: <541302bf-540b-aedb-4ca4-2ba3acfe495e@gmail.com> (message from Gennady Uraltsev on Sat, 8 Apr 2017 18:32:34 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131382 Archived-At: [Please keep the bug address on the CC list.] > From: Gennady Uraltsev > Date: Sat, 8 Apr 2017 18:32:34 +0200 > > The default font that emacs -Q starts with is > > xft:-adobe-Source Code > Pro-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#x2C) > > (I guess it comes from the fact that that is my predefined qt and gtk > monospace font) > > once zooming in (text-scale-adjust INC) I get > > xft:-adobe-Source Code > Pro-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1 (#x1E) > > If instead of zooming in I do M-x buffer-face-set variable-pitch > I get the font > > xft:-unknown-Roboto-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x48) > > > > I can also replicate this by setting the global font to be something > else like > > xft:-unknown-Droid Sans-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1 > (#x54) > xft:-monotype-Noto Sans-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1 > (#x36) > > at the level of the frame by using > > M-x set-frame-font > -unknown-Droid Sans-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1 > or > -monotype-Noto Sans-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1 > > respectively. This does not have a negative impact on performance. But > as soon as I enable something like > > M-x buffer-face-set fixed-pitch or > (text-scale-adjust INC) the problem returns Can you build your own Emacs? If so, could you please apply the following patch and see if it solves the problem? diff --git a/src/font.c b/src/font.c index a929509..bb6d18b 100644 --- a/src/font.c +++ b/src/font.c @@ -2777,21 +2777,22 @@ font_list_entities (struct frame *f, Lisp_Object spec) val = XCDR (val); else { - val = driver_list->driver->list (f, scratch_font_spec); - if (!NILP (val)) - { - Lisp_Object copy = copy_font_spec (scratch_font_spec); + Lisp_Object copy; - val = Fvconcat (1, &val); - ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); - XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); - } + val = driver_list->driver->list (f, scratch_font_spec); + if (NILP (val)) + val = zero_vector; + else + val = Fvconcat (1, &val); + copy = copy_font_spec (scratch_font_spec); + ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); + XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); } - if (VECTORP (val) && ASIZE (val) > 0 + if (ASIZE (val) > 0 && (need_filtering || ! NILP (Vface_ignored_fonts))) val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size); - if (VECTORP (val) && ASIZE (val) > 0) + if (ASIZE (val) > 0) list = Fcons (val, list); }