all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thomas Morgan <tlm@ziiuu.com>
To: 29630@debbugs.gnu.org
Subject: bug#29630: 25.3; Unable to change fontset using :family face attribute
Date: Sat, 09 Dec 2017 16:26:48 -0500	[thread overview]
Message-ID: <871sk3twx3.fsf@ziiuu.com> (raw)

I started Emacs with `emacs -Q' and created a new fontset by entering
the following expression in *scratch* and evaluating it with C-M-x.

  (create-fontset-from-fontset-spec
   "-*-Liberation Mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-liberation")

I wanted to use this as the default font for the frame so I checked
the Emacs Lisp manual.  Section 37.12.1, Face Attributes, explains 
the :family attribute:

  Font family or fontset (a string).  See (emacs)Fonts, for more
  information about font families.  The function `font-family-list'
  (see below) returns a list of available family names.
  See (elisp)Fontsets, for information about fontsets.

According to this, a string representing a fontset can be used
as the value of the :family attribute.

I tried using the fontset alias "fontset-liberation" by evaluating
the following expression in *scratch* as above.

  (progn
    (set-face-attribute 'default nil :family "fontset-liberation")
    (font-at 0 nil "a"))

This changed the frame's font to something other than Liberation Mono
and returned:

  #<font-object "-CYRE-Podkova-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1">

I expected it to be Liberation Mono.

I thought perhaps the problem was that I used the fontset alias
rather than the fontset name, so I tried the fontset name instead:

  (progn
    (set-face-attribute 'default nil :family
                        "-*-liberation mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-liberation")
    (font-at 0 nil "a"))

This signaled an error: "Invalid face foundry".

I checked the manual again and read the sections linked to from the
quote above: (emacs)Fonts and (elisp)Fontsets.  They don't seem to
explain how to specify a fontset with the :family face attribute.

The documentation for the :font attribute doesn't say that it can 
be a fontset.  But (elisp)Font and Color Parameters says the `font'
frame parameter can be the name of a fontset and the frame parameter 
is "equivalent to the `font' attribute of the `default' face".  So 
one can infer that the :font attribute of a face can be a fontset 
name.  I tested this:

  (progn
    (set-face-attribute 'default nil :font
                        "-*-liberation mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-liberation")
    (font-at 0 nil "a"))

This changes the font to Liberation Mono as expected:

  #<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1">

I also tried equivalent expressions with set-face-font and
using the fontset alias, all of which succeeded.

The font is correct but the fontset is actually fontset-auto1, 
not fontset-liberation.  I'll make another report about that.

I think the documentation for the :family attribute should be 
changed to explain how to refer to a fontset if it's possible
to do that.  If it's not possible to specify a fontset with the
:family attribute, the text about fontsets should be removed.

Here is information from report-emacs-bug:

In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
 of 2017-11-05 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
Configured using:
 'configure --disable-dependency-tracking
 --prefix=/nix/store/7px74nmmy9wnl594jsk0lcgz1ygsbwfj-emacs-25.3
 --with-modules --with-x-toolkit=gtk3 --with-xft'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LC_ALL: en_US.utf8
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
"-*-liberation mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-liberation"
Mark set
#<font-object "-CYRE-Podkova-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1">
Mark set
Entering debugger...
Back to top level
Mark set
#<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1">

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils
help-mode easymenu cl-loaddefs pcase cl-lib debug time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 100076 5220)
 (symbols 48 21018 0)
 (miscs 40 3069 127)
 (strings 32 18822 4645)
 (string-bytes 1 764635)
 (vectors 16 15076)
 (vector-slots 8 511125 5409)
 (floats 8 167 42)
 (intervals 56 249 0)
 (buffers 976 18))





             reply	other threads:[~2017-12-09 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09 21:26 Thomas Morgan [this message]
2017-12-10 17:24 ` bug#29630: 25.3; Unable to change fontset using :family face attribute Eli Zaretskii
2017-12-21 15:19   ` handa
2017-12-24  5:25     ` Thomas Morgan
2017-12-27 12:33       ` handa

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sk3twx3.fsf@ziiuu.com \
    --to=tlm@ziiuu.com \
    --cc=29630@debbugs.gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.