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: Sergey Organov
Subject: Re: How to enforce unicode font for all charsets?
Date: Wed, 11 Mar 2020 08:10:39 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Sergey Organov <sorganov@gmail.com>
>> Date: Tue, 10 Mar 2020 14:31:40 +0300
>> 
>> When there is some particular charset property on text, Emacs chooses
>> to render it using font that has corresponding encoding, such as:
>> 
>> x:-xos4-terminus-medium-r-normal--24-240-72-72-c-120-microsoft-cp1251
>> 
>> for windows-1251 charset.
>> 
>> When there is no charset property, the font being used to display the
>> same character is:
>> 
>> xft:-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1
>> 
>> I'd like the latter font to be always used, no matter if and what charset
>> property is active. How do I achieve this goal?
>
> Customize your fontset to specify that font for the charset for which
> Emacs by default doesn't use it.  You will have to add charsets as you
> find them, there's no useful way of specifying a font for all of
> them.

Thanks, I was thinking along these lines indeed. The problem is I can't
figure how exactly do I do it, provided the DejaVu Sans Mono is the font
currently being set through M-x customize-face RET default, and I don't
want to loose the ability to change this way the (only) font I'd like to
use.

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
[...]

and after some more digging, I finally tried:

(set-fontset-font "fontset-auto1" 'windows-1251
  (font-xlfd-name (face-attribute 'default :font))

which evaluates to:

"-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1"

but doesn't seem to have any visible effect. And even if that worked, it
wouldn't immediately pick subsequent customization of the default face
anyway?

What do I miss?

>  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? I mean: "use this font, unless there is
no suitable glyph, in which case turn back to the fancy methods of
considering charsets".

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?

-- Sergey



reply via email to

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