From: Sergey Organov <sorganov@gmail.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to enforce unicode font for all charsets?
Date: Wed, 11 Mar 2020 15:18:34 +0300 [thread overview]
Message-ID: <87tv2vdqzp.fsf@osv.gnss.ru> (raw)
In-Reply-To: <m2wo7rb913.fsf@gmail.com> (Robert Pluim's message of "Wed, 11 Mar 2020 09:17:12 +0100")
Robert Pluim <rpluim@gmail.com> writes:
>>>>>> On Wed, 11 Mar 2020 08:10:39 +0300, Sergey Organov <sorganov@gmail.com> said:
>
> Sergey> Thanks, I was thinking along these lines indeed. The problem is I can't
> Sergey> figure how exactly do I do it, provided the DejaVu Sans Mono is the font
> Sergey> currently being set through M-x customize-face RET default, and I don't
> Sergey> want to loose the ability to change this way the (only) font I'd like to
> Sergey> use.
>
> Sergey> I mean, it looks like I need to modify fontset-auto1, as M-x
> Sergey> describe-fontset RET shows:
>
> Sergey> Fontset: -PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-fontset-auto1
> Sergey> [...]
>
> Sergey> and after some more digging, I finally tried:
>
> Sergey> (set-fontset-font "fontset-auto1" 'windows-1251
> Sergey> (font-xlfd-name (face-attribute 'default :font))
>
> Sergey> which evaluates to:
>
> Sergey> "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1"
>
> You'd want to use nil instead of "fontset-auto1" to affect the current
> frame's fontset, or t to affect the default fontset.
Thank you for suggestion, but still no luck. I've tried both t and nil
to no avail.
That said, for permanent customization in init file, I will need to
specify particular fontset anyway, right?
>
> Sergey> but doesn't seem to have any visible effect. And even if that worked, it
> Sergey> wouldn't immediately pick subsequent customization of the default face
> Sergey> anyway?
>
> Right, fontsets are static. How often do you customize your default
> face? :-)
Admittedly not often, but there are still 2 problems:
1. When I do customize the default face, say in 1 year, and it doesn't
work, how do I find/recall why?
2. The result of (set-fontset-font) will depend on the moment of its
execution relative to application of customization of default face.
> Sergey> What do I miss?
>
> >> Moreover, specifying that font for any charset is probably not
> >> a good idea, since no font covers all of Unicode.
>
> Sergey> Maybe I should be able to express exactly this by specifying, say,
> Sergey> "preferred font" for a fontset? I mean: "use this font, unless there is
> Sergey> no suitable glyph, in which case turn back to the fancy methods of
> Sergey> considering charsets".
>
> By default, set-fontset-font replaces the existing definition. You can
> pass it 'prepend' as the fifth argument to have it add to the front of
> the existing one.
This is not the same as "preferred font(s)" would be if Emacs had them.
> Sergey> Actually, I probably do want to use only this font (and have empty
> Sergey> rectangles or some such in case of missed glyphs). I mean some way to
> Sergey> force Emacs to behave as if this font is the only available font in the
> Sergey> entire system. Still no simple way?
>
> For all characters or just the windows-1251 charset? If the latter
Obviously the former. Just suppose I only install DejaVu Sans Mono font.
Nothing else. No other fonts at all. How would Emacs behave by default
in such a setup? Now I need to force such behavior in a system where
multiple fonts are installed.
>
> (set-fontset-font t 'windows-1251
> (font-xlfd-name (face-attribute 'default :font))
>
> should do that.
Somehow it still doesn't work for me even for windows-1251, dunno why.
-- Sergey
next prev parent reply other threads:[~2020-03-11 12:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 11:31 How to enforce unicode font for all charsets? Sergey Organov
2020-03-10 14:48 ` Eli Zaretskii
2020-03-11 5:10 ` Sergey Organov
2020-03-11 8:17 ` Robert Pluim
2020-03-11 12:18 ` Sergey Organov [this message]
2020-03-11 16:47 ` Eli Zaretskii
2020-03-12 6:53 ` Sergey Organov
2020-03-12 15:10 ` Eli Zaretskii
2020-03-13 6:48 ` Sergey Organov
2020-03-13 9:06 ` Eli Zaretskii
2020-03-13 11:58 ` Sergey Organov
2020-03-13 14:21 ` Eli Zaretskii
2020-03-13 15:03 ` Sergey Organov
2020-03-13 15:55 ` Eli Zaretskii
2020-03-17 4:34 ` Sergey Organov
2020-03-13 13:58 ` Sergey Organov
2020-03-13 14:36 ` Eli Zaretskii
2020-03-13 14:54 ` Sergey Organov
2020-03-13 15:54 ` Eli Zaretskii
2020-03-13 16:22 ` Robert Pluim
2020-03-13 19:44 ` Eli Zaretskii
2020-03-14 16:07 ` Robert Pluim
2020-03-14 16:55 ` Eli Zaretskii
2020-03-13 16:38 ` Sergey Organov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tv2vdqzp.fsf@osv.gnss.ru \
--to=sorganov@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=rpluim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).