Re: How to enforce unicode font for all charsets?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: How to enforce unicode font for all charsets?

Eli Zaretskii
> From: Sergey Organov <[hidden email]>
> Cc: Eli Zaretskii <[hidden email]>
> Date: Wed, 11 Mar 2020 08:10:39 +0300
> I mean, it looks like I need to modify fontset-auto1, as M-x
> describe-fontset RET shows:
> Fontset: -PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-fontset-auto1

No, you want to customize fontset-default.

> and after some more digging, I finally tried:
> (set-fontset-font "fontset-auto1" 'windows-1251
>   (font-xlfd-name (face-attribute 'default :font))

Use 'prepend as the 5th argument of set-fontset-font, for more
predictable results.

> which evaluates to:
> "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1"
> but doesn't seem to have any visible effect.

Please describe how you tested that.

> And even if that worked, it wouldn't immediately pick subsequent
> customization of the default face anyway?

Fontset customizations are independent of faces, so I don't think I
understand what you mean by "picking customizations of the default

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.

> >  Moreover, specifying that font for any charset is probably not
> >  a good idea, since no font covers all of Unicode.
> Maybe I should be able to express exactly this by specifying, say,
> "preferred font" for a fontset?

There's no such thing.  That's not how fontsets in Emacs work.

> Actually, I probably do want to use only this font (and have empty
> rectangles or some such in case of missed glyphs). I mean some way to
> force Emacs to behave as if this font is the only available font in the
> entire system. Still no simple way?

Maybe there is, but I don't know how, and frankly doing that makes
little sense to me.  Emacs was designed to display every possible
character by selecting a suitable font; forcibly displaying some
characters as boxes is against its design.