help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to enforce unicode font for all charsets?


From: Eli Zaretskii
Subject: Re: How to enforce unicode font for all charsets?
Date: Thu, 12 Mar 2020 17:10:27 +0200

> From: Sergey Organov <sorganov@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> Date: Thu, 12 Mar 2020 09:53:05 +0300
> 
> I've tried to add `nil 'prepend` at the end:
> 
> (set-fontset-font t '(#x0 . #x3FFFFF)
>                   (font-xlfd-name (face-attribute 'default :font))
>                   nil 'prepend)
> 
> but it actually unpredictably /stopped/ to do its intended job. Yet
> another mystery to me.

It's not a mystery.  Using 'prepend leaves the original fontset
intact, and just prepends your font to it, instead of replacing.

> > In general, if the default face's font supports some character, Emacs
> > will use that font, so I don't quite understand why you need to
> > customize your fonts just to have characters displayed by the default
> > face's font.  It shouldn't be needed, if the font really supports
> > those characters
> 
> Except that it /is/ needed, as I've described in my original question?

I'd need to see full recipe starting from "emacs -Q" to understand
what exactly is needed and why.

> Are you saying that font from default face should be used despite the
> charset property being set on text? Is my Emacs misconfigured or
> misbehaving then?

I don't know.  If you show a full recipe, I could try understanding
what's going on there in your particular case.

> Is there a knob to turn off charset-dependency of font selection
> algorithms?

There's no such dependency, only the fontset (and the default face's
font) determines what font shall be used.

> > Maybe there is, but I don't know how, and frankly doing that makes
> > little sense to me.
> 
> Well, I do have font that has all the glyphs /I need/, so it'd be the
> simplest solution for me to just tell Emacs to only ever use that one.

Then all you need to do is prepend to the default fontset the setting
with your font for the range of characters that font supports.  That's
it.  Using the entire Unicode range, as you did, is not something I'd
recommend, as it isn't really necessary, and lies to Emacs about the
font's coverage.

> Here is another example of some sense: I get GNUS summary buffer for a
> mixture of mails in different languages. Hieroglyphs makes zero sense to
> me, yet they occupy more space vertically than most of the other glyphs.
> I'd prefer them not to be displayed, and it happened to be rather simple
> when there were no UNICODE fonts (just not install fonts in
> corresponding encodings), but now this is quite a challenge.

That's a strange requirements, and I don't expect it to be shared by
many users.

> Here is an example of a simple configuration that currently seems to be
> not achievable: use font specified by particular face, and never resort
> to anything else unless the font doesn't have needed glyph.

Once again, that's not how font usage in Emacs was designed.  Using a
single font makes little sense for the environment which Emacs is
supposed to present, which is something most users expect.  But you
have the sources, so you can change Emacs to do anything, including
what you are looking for.



reply via email to

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