emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggest installing more fonts?


From: Eli Zaretskii
Subject: Re: Suggest installing more fonts?
Date: Sat, 17 Oct 2020 19:30:51 +0300

> Date: Sat, 17 Oct 2020 16:09:09 +0000
> From: Gregory Heytings <ghe@sdf.org>
> cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > I invite you to read the various font- and fontset-related bug reports 
> > we have, and also relevant posts on Reddit and elsewhere out there.
> 
> Alas, I could not find anything with your indications.

Nonetheless, it's there.

> >> The meaning of my proposal was only to include it _in_ Emacs, in short, 
> >> to use, when it exists, the Unifont glyph in produce_glyphless_glyph() 
> >> instead of creating a tofu with a hexcode.
> >
> > As I wrote, this is not easily done, as font installation is a 
> > system-wide action, as the font needs to be known by the system-wide 
> > utilities and libraries we use for font searching.
> 
> Apparently it's not clear, so I'll say one last time that the feature I 
> propose does _not_ require to install Unifont system-wide.  It is to 
> include Unifont in Emacs (say in etc/unifont), and to offer it as an 
> additional option for glyphless-char-display, along with hex-code, 
> empty-box, thin-space, and zero-width.  The bitmap data would be used to 
> draw the glyph in produce_glyphless_glyph() .

I don't understand this proposal.  Are you saying Emacs can already
use a font that is not installed?  If so, can you tell how to do that?

The way Emacs uses fonts is by using various system libraries, such as
Fontconfig, to find fonts that match certain criteria (script,
encoding, character codepoint, size, slant, etc.).  How do you propose
to do that if, for example, Fontconfig knows nothing about a font?

> FYI, that feature is not "already in Emacs", as you said: when Unifont is 
> installed, it takes precedence over some (but not all, I'm not sure why) 
> of the better-looking available fonts.  One example: DejaVu Sans has 
> hebrew characters, but with Unifont installed hebrew characters are 
> displayed with Unifont.

This actually means that Unifont is more "in Emacs" than I thought. ;-)

Anyway, did you check the coverage of Hebrew by DejaVu Sans? does it
cover Hebrew?  In any case, Emacs uses Fontconfig to tell which fonts
cover what characters, so I'm guessing the answer is in what
Fontconfig thinks.  (Of course, this is a separate issue, and I'm not
sure we should discuss it in this thread.)

> By the way, while doing various experiments around that question, I found 
> a bug in ftcrfont.c.  If a buffer is displayed with a certain font, and 
> that font is removed, Emacs segfaults when it redisplays that buffer. 
> The bug is in ftcrfont_open, on line 237:
> 
> ft_face = cairo_ft_scaled_font_lock_face (scaled_font);
> 
> This line should be followed by a:
> 
> if (!ft_face)
>    {
>      unblock_input ();
>      /* further cleanup? */
>      return Qnil;
>    }

We had already such a patch submitted, but not installed for some
reason I cannot understand, and it was just recently mentioned on
bug-gnu-emacs (together with a few more places where such a test is
needed).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]