all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ralf Jung <post@ralfj.de>
Cc: 21028@debbugs.gnu.org
Subject: bug#21028: Slow font rendering in emacs
Date: Wed, 15 Mar 2017 17:36:57 +0200	[thread overview]
Message-ID: <83zigma6w6.fsf@gnu.org> (raw)
In-Reply-To: <f881d341-005a-c94b-84c4-897114ab6420@ralfj.de> (message from Ralf Jung on Tue, 14 Mar 2017 20:39:56 +0100)

> Cc: 21028@debbugs.gnu.org
> From: Ralf Jung <post@ralfj.de>
> 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
> <no idea what it does>"

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.





  parent reply	other threads:[~2017-03-15 15:36 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 10:34 bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00ef86fac835b5fac (Apr 2014) Clément Pit--Claudel
2015-07-10 12:30 ` Eli Zaretskii
2015-07-10 16:02   ` Clément Pit--Claudel
2015-07-10 12:41 ` Eli Zaretskii
2015-07-10 16:55   ` Clément Pit--Claudel
2015-07-15 12:32     ` Dmitry Antipov
2015-07-18 10:24       ` Clément Pit--Claudel
2015-07-18 11:16         ` Clément Pit--Claudel
2015-07-18 11:26           ` Eli Zaretskii
2015-07-18 20:08             ` Clément Pit--Claudel
2016-03-03  6:12       ` Clément Pit--Claudel
2016-03-03  6:42         ` Clément Pit--Claudel
2016-03-03  7:08           ` Clément Pit--Claudel
2016-03-03  7:33             ` Clément Pit--Claudel
2016-03-03 17:10               ` Glenn Morris
2016-03-03 17:28                 ` Clément Pit--Claudel
2016-03-03 20:27               ` Eli Zaretskii
2016-07-20 21:26                 ` Clément Pit--Claudel
2016-07-21 14:21                   ` Eli Zaretskii
2016-07-21 14:33                     ` Clément Pit--Claudel
2016-07-23 20:50                     ` Clément Pit--Claudel
2016-10-04 22:17                       ` Clément Pit--Claudel
2016-10-26 17:15                         ` Clément Pit--Claudel
2016-10-27 14:38                           ` Eli Zaretskii
2016-10-27 15:29                             ` Clément Pit--Claudel
2016-10-27 15:55                               ` Eli Zaretskii
2016-10-28 14:23                                 ` Clément Pit--Claudel
2016-10-28 14:33                                   ` Eli Zaretskii
2016-11-18  8:55                                     ` Eli Zaretskii
2016-12-18 17:33                                     ` Clément Pit--Claudel
2016-12-18 17:37                                       ` Eli Zaretskii
2016-12-18 18:04                                         ` Clément Pit--Claudel
2016-12-18 19:52                                           ` Eli Zaretskii
2016-12-18 20:44                                             ` Clément Pit--Claudel
2016-12-19 15:50                                               ` Eli Zaretskii
2016-12-19 16:25                                                 ` Clément Pit--Claudel
2016-12-19 16:39                                                   ` Eli Zaretskii
2016-12-19 16:55                                                     ` Clément Pit--Claudel
2016-12-19 16:58                                                       ` Eli Zaretskii
2016-12-19 17:13                                                         ` Clément Pit--Claudel
2016-12-22 16:25                                                           ` Eli Zaretskii
2016-12-22 16:49                                                             ` Clément Pit--Claudel
2016-12-22 18:04                                                               ` Eli Zaretskii
2016-12-22 19:08                                                                 ` Clément Pit--Claudel
2017-02-10  4:45                                                                   ` Clément Pit--Claudel
2017-03-12 11:38                                                                     ` Clément Pit--Claudel
2017-03-12 15:49                                                                       ` Eli Zaretskii
2017-03-12 17:24                                                                         ` Clément Pit--Claudel
2017-03-12 17:48                                                                           ` Eli Zaretskii
2017-03-12 19:19                                                                             ` Clément Pit--Claudel
2017-03-13 15:46                                                                               ` Eli Zaretskii
2017-03-13 16:36                                                                                 ` Clément Pit--Claudel
2017-03-13 17:22                                                                                   ` Eli Zaretskii
2017-03-13 19:04                                                                                     ` Clément Pit--Claudel
2017-03-13 20:53                                                                                       ` Eli Zaretskii
2017-03-14 19:45                                                                                         ` Clément Pit--Claudel
2017-03-15 15:37                                                                                           ` Eli Zaretskii
2017-03-14 15:45                                                                                       ` Eli Zaretskii
2017-03-14 19:35                                                                                         ` Clément Pit--Claudel
2017-03-15 15:36                                                                                           ` Eli Zaretskii
2017-03-15 20:46                                                                                             ` Clément Pit--Claudel
2017-03-16 15:27                                                                                               ` Eli Zaretskii
2017-03-16 21:23                                                                                                 ` Clément Pit--Claudel
2017-03-17  8:15                                                                                                   ` Eli Zaretskii
2017-04-16  7:48                                                                                                 ` Eli Zaretskii
2017-04-16 15:28                                                                                                   ` Clément Pit--Claudel
2016-12-19 17:00                                                     ` Clément Pit--Claudel
2015-07-10 15:42 ` Glenn Morris
2016-03-03  6:37   ` Clément Pit--Claudel
2016-10-04 18:56 ` Jason Gross
2017-03-13 15:54 ` bug#21028: Slow font rendering in emacs Ralf Jung
2017-03-13 17:05   ` Eli Zaretskii
2017-03-13 18:12     ` Ralf Jung
2017-03-13 20:39       ` Eli Zaretskii
2017-03-14 15:57         ` Ralf Jung
2017-03-14 17:11           ` Eli Zaretskii
2017-03-14 18:50             ` Ralf Jung
2017-03-14 19:16               ` Eli Zaretskii
2017-03-14 19:17             ` Ralf Jung
2017-03-14 20:49             ` John Mastro
2017-03-15 15:40               ` Eli Zaretskii
2017-03-14 15:47   ` Eli Zaretskii
2017-03-14 18:41     ` Ralf Jung
2017-03-14 19:16       ` Eli Zaretskii
2017-03-14 19:39         ` Ralf Jung
2017-03-14 19:45           ` Ralf Jung
2017-03-15 15:36           ` Eli Zaretskii [this message]
2017-04-22  8:54             ` Ralf Jung
2017-04-22 13:40               ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zigma6w6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21028@debbugs.gnu.org \
    --cc=post@ralfj.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.