all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 30874@debbugs.gnu.org, jsynacek@redhat.com
Subject: bug#30874: 27.0.50; Emacs crashes
Date: Thu, 29 Mar 2018 20:07:54 +0300	[thread overview]
Message-ID: <83sh8idd3p.fsf@gnu.org> (raw)
In-Reply-To: <87po3mdfl8.fsf@gmail.com> (message from Robert Pluim on Thu, 29 Mar 2018 18:14:11 +0200)

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 30874@debbugs.gnu.org,  jsynacek@redhat.com
> Date: Thu, 29 Mar 2018 18:14:11 +0200
> 
> > We already use fontconfig to some extent, and xftfont is AFAIK the
> > most advanced font backend we have.  Patches for switching to using
> > more of fontconfig's features (assuming it can replace Xft), or for
> > switching to a more modern back-end (harfbuzz?) are welcome, but I
> > don't hold my breath, as I don't think we have expert on board who
> > know enough about complex script shaping to make progress in those
> > directions.
> 
> As I understand it, we should use fontconfig for finding fonts,
> harfbuzz for doing the layout, and cairo to actually render the
> result

Does harfbuzz require Cairo?  If it does, that's unfortunate, because
the Cairo rendering option currently has a few known and annoying
redisplay bugs, which no one seems to be willing/capable of fixing.

> plus itʼs Emacs redisplay, which Iʼm told is scary

Don't believe the rumors too much.  Besides, adding a font backend
doesn't require to mess with the display code in any way, all you need
is implement the interfaces you see documented in 'struct font_driver'
defined in font.h (reusing the methods of existing backends where
appropriate, as xftfont does with ftfont methods); all the rest is
already taken care of in the infrastructure.  The only interface
between font back-end methods and the display engine is via 'struct
glyph_string', which is a relatvely simple data structure.

> I do note we have an Xft font backend, a freetype one, and a
> freetype+cairo one already, which seems excessive.

You forgot xfont and freetype-without-XFT.  It could be that we could
remove some of them, but I don't know which ones are used and how
much.  And freetype+cairo is not used much because of the Cairo
problems.

> > As a stopgap, I think we should find a way of ignoring the problematic
> > fonts.  Is there some way of detecting them?
> 
> You mean short of running ftfont_get_bitmap over every available
> codepoint in the font and skipping it if the resulting width * height
> is > 4096 [1]?  That would probably detect a problematic font pretty
> quickly, but is not very elegant. Also Iʼm not sure we get to
> intervene before Xft decides that it needs to fall back to that font.

AFAIK, there's no "fallback" per se.  Whenever the already-loaded
fonts don't support a character, Emacs looks for the fonts that do
using the "match" method.  If we always fail these fonts in that
method, they will never be used.

> > AFAICT, we could do that
> > either in ftfont_match or in its subroutine ftfont_spec_pattern.  We
> > could then pretend that these fonts don't match any font spec, perhaps
> > subject to some variable (which would provide a 'fire escape"), which
> > I think would fix the problem.
> 
> Iʼm hoping that matching on something like !'family emoji' would work,
> although Iʼve not figured out how to express that in fontconfig-speak.

I thought there could be a way of detecting those "color bitmap fonts"
by examining their attributes in ftfont_match and/or
ftfont_spec_pattern.  Then we could return a failure indication for
them.





  reply	other threads:[~2018-03-29 17:07 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 10:24 bug#30874: 27.0.50; Emacs crashes Jan Synacek
2018-03-20 12:04 ` Eli Zaretskii
2018-03-20 12:12   ` Jan Synacek
2018-03-20 12:44     ` Eli Zaretskii
2018-03-22 12:28       ` Jan Synacek
2018-03-22 13:01         ` Eli Zaretskii
2018-03-22 13:05           ` Jan Synacek
2018-03-22 14:55             ` Eli Zaretskii
2018-03-26  9:12               ` Jan Synacek
2018-03-26 10:33                 ` Robert Pluim
2018-03-26 15:25                   ` Eli Zaretskii
2018-03-26 16:52                     ` Robert Pluim
2018-03-26 17:33                       ` Eli Zaretskii
2018-03-26 20:17                         ` Robert Pluim
2018-03-26 22:16                           ` Robert Pluim
2018-03-27  3:02                             ` Eli Zaretskii
2018-03-27  8:57                               ` Robert Pluim
2018-03-29 10:25                                 ` Eli Zaretskii
2018-03-29 16:14                                   ` Robert Pluim
2018-03-29 17:07                                     ` Eli Zaretskii [this message]
2018-03-30  5:10                                       ` Glenn Morris
2018-03-30  8:00                                         ` Eli Zaretskii
2018-03-30 10:36                                       ` Robert Pluim
2018-03-30 11:46                                         ` Eli Zaretskii
2018-03-30 13:00                                           ` Robert Pluim
2018-03-30 13:46                                             ` Eli Zaretskii
2018-03-31 13:55                                               ` Robert Pluim
2018-03-31 14:59                                                 ` Eli Zaretskii
2018-04-03  9:24                                                   ` Robert Pluim
2018-04-03  8:00                                           ` Jan Synacek
2018-04-03  9:22                                             ` Robert Pluim
2018-04-03  9:42                                               ` Eli Zaretskii
2018-04-03 12:52                                                 ` Robert Pluim
2018-03-29 10:35                               ` Jan Synacek

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=83sh8idd3p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=30874@debbugs.gnu.org \
    --cc=jsynacek@redhat.com \
    --cc=rpluim@gmail.com \
    /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.