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

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

bug#49797: 28.0.50; Setting face to custom fontset doesn't work


From: handa
Subject: bug#49797: 28.0.50; Setting face to custom fontset doesn't work
Date: Mon, 02 Aug 2021 20:57:48 +0900

> > From: Yuan Fu <casouri@gmail.com>
> > Date: Sat, 31 Jul 2021 17:37:05 -0400
> > 
> > If I evaluate the following:
> > 
> > (progn
> >   (create-fontset-from-fontset-spec
> >    (font-xlfd-name
> >     (font-spec :registry "fontset-lunamono")))
> >   (set-fontset-font "fontset-lunamono" 'latin (font-spec :family "SF Mono"))
> >   (set-face-attribute 'default nil :fontset "fontset-lunamono”))
> > 
> > I expect Latin characters to be shown in SF Mono font, but that’s not what 
> > happened. If I instead set font for the default fontset, the characters in 
> > the buffer are correctly displayed in SF Mono font. I tried this code 
> > snippet with Emacs 26, 27 and 28, and all of them have this problem.
> > 

Please try (set-face-attribute 'default nil :font "fontset-lunamono").

The docstring of set-face-attribute says:
------------------------------------------------------------
...
‘:font’

Set font-related face attributes from VALUE.
VALUE must be a valid font name or font object.  It can also
be a fontset name.  Setting this attribute will also set
^^^^^^^^^^^^^^^^^
the ‘:family’, ‘:foundry’, ‘:width’, ‘:height’, ‘:weight’,
and ‘:slant’ attributes.
------------------------------------------------------------

> Personally, I lack a clear understanding of how user-defined fontsets
> are supposed to be used instead of the standard fontsets.  Is that
> only by using the :font attribute of a face?

In article <83v94pm80c.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:
[...]
> I think the :fontset attribute isn't supposed to be set by Lisp
> programs.  It's for internal use.

I don't remember well, but I tend to agree.  RMS's request was to make
fontset acceptable at any places where a font is accepted.

---
K. Handa
handa@gnu.org





reply via email to

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