all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ralf Jung <post@ralfj.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21028@debbugs.gnu.org
Subject: bug#21028: Slow font rendering in emacs
Date: Mon, 13 Mar 2017 19:12:10 +0100	[thread overview]
Message-ID: <ba7ba5d8-118c-a87d-159a-b206f4e12676@ralfj.de> (raw)
In-Reply-To: <83zigpayz8.fsf@gnu.org>

Hi Eli,

Wow, that was a quick reply!

>> From: Ralf Jung <post@ralfj.de>
>> 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
>> <https://gitlab.mpi-sws.org/robbertkrebbers/coq-stdpp/raw/master/theories/list.v>)
>> 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





  reply	other threads:[~2017-03-13 18:12 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 [this message]
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
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=ba7ba5d8-118c-a87d-159a-b206f4e12676@ralfj.de \
    --to=post@ralfj.de \
    --cc=21028@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.