From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ralf Jung Newsgroups: gmane.emacs.bugs Subject: bug#21028: Slow font rendering in emacs Date: Mon, 13 Mar 2017 19:12:10 +0100 Message-ID: References: <559F9FAF.8090708@live.com> <83zigpayz8.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1489428794 1052 195.159.176.226 (13 Mar 2017 18:13:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Mar 2017 18:13:14 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: 21028@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 13 19:13:08 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 1cnUSw-0007yy-EH for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Mar 2017 19:13:06 +0100 Original-Received: from localhost ([::1]:53716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnUT2-0000B8-7y for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Mar 2017 14:13:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnUSv-0000Aq-9f for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 14:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnUSs-0006K7-2i for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 14:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnUSr-0006K1-Ub for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 14:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cnUSr-0004pC-PZ for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 14:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ralf Jung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Mar 2017 18:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21028 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21028-submit@debbugs.gnu.org id=B21028.148942874318501 (code B ref 21028); Mon, 13 Mar 2017 18:13:01 +0000 Original-Received: (at 21028) by debbugs.gnu.org; 13 Mar 2017 18:12:23 +0000 Original-Received: from localhost ([127.0.0.1]:54190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnUSF-0004oK-HK for submit@debbugs.gnu.org; Mon, 13 Mar 2017 14:12:23 -0400 Original-Received: from eins.ralfj.de ([85.214.220.216]:38385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnUSB-0004o5-Nr for 21028@debbugs.gnu.org; Mon, 13 Mar 2017 14:12:20 -0400 Original-Received: from [192.168.1.110] (p54A58106.dip0.t-ipconnect.de [84.165.129.6]) by mx.ralfj.de (Postfix) with ESMTPSA id 0824117D0204; Mon, 13 Mar 2017 19:12:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ralfj.de; s=mail; t=1489428733; bh=pgWtz77ueWxW6Tls3bbjH8UHWHOTdQlbtFCnGOUM6as=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=rk0KrZiUijSHoLHwyiOFfV9Xbsi12g5XmtC0nFzIUonhuh/JtbT8MqHrjKm7O2W63 /eJzL1LWQpCIcYoLli6hNaqSz94FLyVOnSlIUK6+tRJO3WxeQo5ifCTNE4XmJ7o+Cw gpeGqYQOqp9WYDCcj51YYbvcH1MK3KkZZCSw3QxU= In-Reply-To: <83zigpayz8.fsf@gnu.org> 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:130549 Archived-At: Hi Eli, Wow, that was a quick reply! >> From: Ralf Jung >> Date: Mon, 13 Mar 2017 16:54:01 +0100 >> >> I think I ran into the issue described here as well: If I am not >> careful with the way I configure my fonts, emacs becomes pretty slow at >> rendering them. With my old laptop, actually merely navigating the >> cursor large files (like >> ) >> already was noticeably luggish. > > I don't see any sluggish-ness in "emacs -Q" here, FWIW. > > Do you have any measurements that would show the slowdown in numbers? I know very little about emacs, so I wouldn't know how to make any measurements. Also, I don't have access to my old machine any more. I may try adapting some of the timing scripts that you and Clément were using, and see if I can quantify anything. > Also, what is your value of system-configuration-options and > system-configuration-features? And which version of Emacs is that? Sorry, I have no idea how to read those variables and a quick google search was not very fruitful. This is emacs 24.5+1-8 as packaged by Debian. > What happens if you don't make any of the above customizations? Emacs is fine in terms of speed, but it uses the wrong font for characters not supported by Fira Sans Mono. For example, for ∃ it picks "STIX", which seems to have broken metrics because the character is higher than all the others (it extends ~20% below the bottom bar, breaking the height of the entire line). For ∗ it picks DejaVu Math TeX Gyre, which is too wide. For ⋅ it picks EB Garamond SC which is way too small. Opening the same file on the same system in Kate or gedit results in the expected rendering -- all characters fit the grid; unfortunately I don't know how to figure out which fonts they picked for what. I did no configuration whatsoever to achieve this, besides installing Fira Sans. This was the case even before I installed Symbola. > Also, do you have the Symbola font installed? If not, can you install > it and see if that makes things better? I do have it installed. emacs doesn't seem to pick it per default. The reason I have it installed is that some characters (like ∖) are supported neither by Fira Sans Mono nor by DejaVu Mono, so then I made it fall back to Symbola. These are very few rarely used characters, so the fact that the widths don't match up is much less of a problem. My full configuration is: ;; Fonts (dolist (ft (fontset-list)) ; Main font (set-fontset-font ft 'unicode (font-spec :name "Monospace" :size 11.0)) ; Fallback font ; Appending to the 'unicode list makes emacs unbearably slow. ;(set-fontset-font ft 'unicode (font-spec :name "DejaVu Sans Mono" :size 11.0) nil 'append) (set-fontset-font ft nil (font-spec :name "DejaVu Sans Mono" :size 11.0)) ) ; Fallback-fallback font ; If we 'append this to all fontsets, it picks Symbola even for some cases where DejaVu could ; be used. Adding it only to the "t" table makes it Do The Right Thing (TM). (set-fontset-font t nil (font-spec :name "Symbola" :size 11.0)) And just in case you wonder -- no, I have no idea what I am doing here. I arrived at that configuration after several hours of random, fairly unguided modifications to it until all my test characters picked the font I wanted: → Fira Sans Mono (even though DejaVu can also do it, but the arrow in Fira looks much better IMHO) ∃ DejaVu Mono (not supported by Fira, it seems) ∀ DejaVu Mono (not supported by Fira, it seems) ∗ DejaVu Mono (not supported by Fira, it seems) ⋅ DejaVu Mono (not supported by Fira, it seems; the one in Symbola is *tiny*) ∖ Symbola (for lack of an alternative) I shortened the configuration in my first mail because I was focusing on the performance issue. While I do consider it a bug that emacs picks the wrong fonts per default, shouldn't emacs be reasonably fast to use even if I do some manual configuration? The bug at hand IMHO wouldn't be fixed if the default emacs configuration was making better choices for the fonts (though of course I wouldn't be affected by it anymore; but then, neither am I now since I found a way to work around it). >> Configuring fonts in emacs to get proper unicode rendering is already >> fairly difficult > > Actually, the default fontset is supposed to "just work", so I'd be > interested to hear why you needed to customize that. > I'm trying. But it's hard, since for now I cannot even reproduce it. I acknowledge that it'd be much easier if you could reproduce the problem. That said, there's a patch that Clément said works. Honestly I am a little puzzled why you are so hesitant to apply a patch that you wrote, and that reportedly fixes the problem. Do you expect that patch to have negative side-effects? Of course this is ultimately up to you, I am just expressing my surprise here. Kind regards, Ralf