GNU bug report logs - #29630
25.3; Unable to change fontset using :family face attribute

Previous Next

Package: emacs;

Reported by: Thomas Morgan <tlm <at> ziiuu.com>

Date: Sat, 9 Dec 2017 21:41:01 UTC

Severity: normal

Found in version 25.3

Full log


Message #17 received at 29630 <at> debbugs.gnu.org (full text, mbox):

From: handa <handa <at> gnu.org>
To: Thomas Morgan <tlm <at> ziiuu.com>
Cc: 29630 <at> debbugs.gnu.org, eliz <at> gnu.org
Subject: Re: bug#29630: 25.3;
 Unable to change fontset using :family face attribute
Date: Wed, 27 Dec 2017 21:33:04 +0900
In article <87zi68elz1.fsf <at> ziiuu.com>, Thomas Morgan <tlm <at> ziiuu.com> writes:

> `:font'
>      [...] If you specify a string, the contents of the string should
>      be a font name (*note (emacs)Fonts::); if the font name is an XLFD
>      containing wildcards, Emacs chooses the first font matching those
>      wildcards. [...]

> Would it make sense to add the following after the quoted sentence?

>   You may also specify a fontset name as a string.  For reasons of
>   backward compatibility, in the case of the `default' face this may
>   automatically generate a new fontset based on the family, weight,
>   size, and other font-related properties of the specified fontset.

The generation of a new fontset happens every time you change a font of
the default face; not only when you specify a fontset for :font.

So, here, as an explanation of :font, I think what we have to say is that
specifying a fontset name is the same as specifying a font that the
fontset defines for ASCII.  For instance,

Even if yoy create a fontset as this name:
  (create-fontset-from-fontset-spec
   "-*-dejavu sans mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-dejavu")
when you do:
  (set-fontset-font "fontset-dejavu" 'unicode-bmp (font-spec :family "Freemono"))
giving "fontset-dejavu" to :font is the same as giving
  (font-spec :family "Freemono").

> It would probably also be helpful to document the :fontset attribute
> in the manual, if that's the proper way to specify a fontset for the
> the frame's default face.

I don't remember how :fontset attribute works here, sorry. :-(
I tried:
  (set-face-attribute 'default nil :fontset "fontset-dejavu")
but it seems that it has no effect?!?

On the other hand,
  (modify-frame-parameters nil '((font . "fontset-dejavu")))
works.

> > At least, calling set-fontset-font for the fontset of the current frame
> > should work... and worked as far as I rememnber... but I've just found
> > that this does not work with the latest Emacs?!?
> >
> > (set-fontset-font nil 'unicode-bmp "dejavu sans mono")
> > (set-fontset-font nil 'unicode-bmp "Freemono" nil 'append)
> >
> > I'm now checking what is wrong.

That was my misunderstanding, sorry.  I have two versions of freemono
fonts, ttf and otf, and Emacs (or fontconfig) found otf version, but I
was expecting ttf version that has more glyphs.

---
K. Handa
handa <at> gnu.org




This bug report was last modified 7 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.