GNU bug report logs -
#30874
Displaying char \x274C with Dejavu Sans Mono gives "X protocol error: BadLength (poly request too large or internal Xlib length error) on protocol request 138"
Previous Next
Reported by: Jan Synacek <jsynacek <at> redhat.com>
Date: Tue, 20 Mar 2018 10:26:01 UTC
Severity: important
Tags: fixed
Merged with 30045,
31547,
31758,
31801,
31936
Found in versions 26.1, 27.0.50, 25.3
Fixed in version 26.2
Done: Robert Pluim <rpluim <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: 30874 <at> debbugs.gnu.org, jsynacek <at> 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.
This bug report was last modified 6 years and 164 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.