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#21028: Slow font rendering in emacs Date: Wed, 15 Mar 2017 17:36:57 +0200 Message-ID: <83zigma6w6.fsf@gnu.org> References: <559F9FAF.8090708@live.com> <83innbc122.fsf@gnu.org> <4000d0c9-493c-3e14-f070-f35555e240dd@ralfj.de> <8360jbbrey.fsf@gnu.org> Reply-To: Eli Zaretskii 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 1489592292 11191 195.159.176.226 (15 Mar 2017 15:38:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Mar 2017 15:38:12 +0000 (UTC) Cc: 21028@debbugs.gnu.org To: Ralf Jung Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 15 16:38: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 1coB02-0002Hc-DM for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Mar 2017 16:38:06 +0100 Original-Received: from localhost ([::1]:38049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coB08-0003ey-ID for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Mar 2017 11:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coB01-0003er-Ry for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 11:38:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coAzx-0002Ba-Uj for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 11:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59147) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1coAzx-0002BT-Qe for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 11:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1coAzx-00070A-KW for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 11:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Mar 2017 15:38: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.148959225526878 (code B ref 21028); Wed, 15 Mar 2017 15:38:01 +0000 Original-Received: (at 21028) by debbugs.gnu.org; 15 Mar 2017 15:37:35 +0000 Original-Received: from localhost ([127.0.0.1]:57346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coAzW-0006zS-UR for submit@debbugs.gnu.org; Wed, 15 Mar 2017 11:37:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coAzW-0006zG-5Z for 21028@debbugs.gnu.org; Wed, 15 Mar 2017 11:37:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coAzP-0001wD-RN for 21028@debbugs.gnu.org; Wed, 15 Mar 2017 11:37:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coAzP-0001vW-O9; Wed, 15 Mar 2017 11:37:27 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1238 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1coAzO-00089L-Qd; Wed, 15 Mar 2017 11:37:27 -0400 In-reply-to: (message from Ralf Jung on Tue, 14 Mar 2017 20:39:56 +0100) 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:130614 Archived-At: > Cc: 21028@debbugs.gnu.org > From: Ralf Jung > Date: Tue, 14 Mar 2017 20:39:56 +0100 > > > IOW, the way to fix this is to augment the existing default fonts or > > maybe create an additional ready-to-be-used fontset that users could > > simply tell Emacs to use, without any tinkering. > > I think we can agree that ideally, the default should DTRT. I was indeed talking what the default should do. If it doesn't do TRT in your case (without any customizations of the fontsets), I suggest to describe the problems in a bug report, so that the defaults could be augmented to cater to your use cases. > Unfortunately, I noticed no change when upgrading to Emacs 25; that may > be because of which exact fonts I have installed. Could be, I don't know. Once again, if the defaults, without any font customizations, are somehow not good for you, please report the details in a bug report. > > The more sensible way is to specify explicit ranges of codepoints > > where you want certain fonts, and leave the rest to the defaults. > > Well, IMHO it is not very sensible to do this manually. For example, > the supported codepoint ranges of the fonts won't change during the > runtime of Emacs, so Emacs could perfectly well build a more refined > per-block fallback cascade from the coarse-grained information I provide > (essentially caching the information whether a font supports no, some, > or all characters of any given block). If you are asking for an Emacs feature that could map the installed fonts and find out which characters they support, this should be doable, if someone writes the code. But the assumption that the installed fonts rarely change is not a universally valid one: I know people who install new fonts every day. > On a high level, what I want to achieve is for things to look like they > do in Kate/gedit. ;) Now that's probably not very instructive, so here > is what I think these editors pick for various characters, just to give > you some examples (deduced by checking that the characters look the same > in emacs and Kate, and then asking emacs which font it used): > all basic ASCII, Latin, Greek characters: Fira Sans Mono > → Fira Sans Mono > ∃ 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) I would begin by specifying Fira Sans Mono as your default font, via default-frame-alist. Then see if some of the above are not displayed as you like, and fix that via fontset-default. It sounds like all the characters for which you need DejaVu Mono are punctuation and symbols, so setting up DejaVu Mono for the range '(#x2200 . #x22FF) should do. If you want more symbols, try '(#x2200 . #x232F), it looks like DejaVu Mono has good coverage in this larger range. > Of course this is just an excerpt of the characters we use. From all I > can tell, the general rule is "if the character is supported by Fira, > use that font; else of it is supported by DejaVu, use that font; else do > " As you have seen, this does work as you want, but it's slow. We are talking about getting you the same functionality, but faster. That comes for a price of more accurate fontset setup. > >> You say these fonts support only Latin, Cyrillic and Greek -- but for > >> example Fira Sans Mono supports → and … and ↑, and DejaVu Mono supports > >> ∃ and ↦ and ▷. Are these all in one of these ranges? > > > > No. But the rest of the blocks are covered only very partially, > > Wait -- if Fira already covers the entire Latic, Greek and Cyrillic > range, how can it make any sense to even have a fallback to DejaVu here? You tell me, I don't know your exact needs. Maybe I guessed them above, and all you need is more punctuation and symbols, because Fira has very incomplete coverage of those. Emacs 25 will use the default face's font for any symbol and punctuation characters supported by that font, so you only need fallbacks where those characters are not available in Fira. That's what the above blocks should achieve by configuring DejaVu Sans for them. > I thought the entire purpose of these fallback chains was to deal with > fonts supporting random characters in some blocks, so that one cannot > tell in advance exactly which font to use for which block. It can be used like that, but then it could be slow. > So, maybe I could figure out which 2 or 3 unicode blocks all the special > characters are in, and then I could set up Fira followed by DejaVu just > for these blocks. Then I could have emacs pick the fonts I want without > being slow. My suggestions for that are above. Maybe that's what you need. > I don't think the font is to blame here. After all, other applications > manage to deal with exactly the same fonts just fine. > Unfortunately, I don't know *how* everybody else is selecting fonts, I > only know they do a better job at it than emacs, and they have no > problem dealing with fonts that only partially support some blocks. > Probably fontconfig is doing most of the work here, but I am really just > guessing. Most other applications don't deal with multi-lingual text, so their job is easier. Emacs attempts to solve a harder problem here.