From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thomas Morgan Newsgroups: gmane.emacs.bugs Subject: bug#29630: 25.3; Unable to change fontset using :family face attribute Date: Sat, 09 Dec 2017 16:26:48 -0500 Message-ID: <871sk3twx3.fsf@ziiuu.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1512855682 16778 195.159.176.226 (9 Dec 2017 21:41:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2017 21:41:22 +0000 (UTC) To: 29630@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 09 22:41:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNmrx-000428-49 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Dec 2017 22:41:13 +0100 Original-Received: from localhost ([::1]:42648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNms1-0000dJ-Gt for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Dec 2017 16:41:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNmrr-0000cm-3O for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:41:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNmrm-0003ym-Fk for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:41:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNmrm-0003yc-Bi for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eNmrm-0004bY-1b for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Morgan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Dec 2017 21:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29630 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151285562917637 (code B ref -1); Sat, 09 Dec 2017 21:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Dec 2017 21:40:29 +0000 Original-Received: from localhost ([127.0.0.1]:54247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNmrE-0004aO-DW for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:40:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNmeG-0004GZ-Vg for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:27:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNmeA-0003FR-HY for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:26:59 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNmeA-0003Ey-DC for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:26:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNme8-0003Tp-N3 for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:26:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNme5-00039r-HI for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:26:56 -0500 Original-Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]:38402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNme5-00038r-6q for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:26:53 -0500 Original-Received: by mail-io0-x236.google.com with SMTP id d14so5871360ioc.5 for ; Sat, 09 Dec 2017 13:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziiuu-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=GCK8S39chXhuCnGX7nqetWqkufb/pRbNKfkFkXqdzCA=; b=IA+lz3J/IrH7eZQHroIhknBL8mPrcVW1UpH4xx8q84f3ALMP46MwH5eRAeCit8R/LF oDFq9GFPXbnjLIiBVTbNti15IeLDzzWsJe1edeqObTBp/VWuQUJb8AGNMl1o0Qv6o8mo /zNFvE95hW70DY5gJ9ESy+WBYeOVpIafih5UYdbaaTt454fFrWgptGwzTBb1N+U+h5uu Cme3rk4c/h57Umk8HF3zenAHTCHq8nKauWKc53hFPGajfJvMAk08Nn8kVnYFHBpWwJ/h pwZB7YpzyrTWfpa74exHE/4UNhLiWXYuk05kCh50xIqH7Jfn3cnNsuYyIpHZSieZBobv vYVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=GCK8S39chXhuCnGX7nqetWqkufb/pRbNKfkFkXqdzCA=; b=IsQTM40tbh5nqoPQwn1uJfgAbz9onfD0+6zEDW0tPU39rJvytP+C3VmUy9z7tLGjBB xkesDL7gIjaoDmZ/T3SAollA8189Bm7fODx+0Wtb44HejfsWPE4Dulrv5jNKQI5RT+6P h3VqV73PyvTmIRC+nXJh3mfZ9xMg1PzTxZhj86gUnnsBk9QUgDVnOBscqP5wsVNJP9ki hPeuiHcXHPrZo53E3Sq3oABar63beuDP3Y5ctfLdsvZ1nIYopyJASxz6rxeQjN6uDqKx 1y95ZzL9VNHZ3NIdwdPjeP3DICnGC7R08UfypFPtNBEdJc0sonYtNCCx6xbbBuTf+Fa3 orJQ== X-Gm-Message-State: AKGB3mJmN8YYrf7RF+BVeUSYjKU68BqflNUiyKMesG1QWXowVEU/YAmf FfdGPrz7wJdCX2lKIMN19pY0c8gY X-Google-Smtp-Source: AGs4zMYuX8pzXsfkr8Nf7Vz0UCfLb6g6IHDNf2VPZJhJLcrRwFMMZ6txgFeq4rIjepgwut2G1NVYBw== X-Received: by 10.107.182.196 with SMTP id g187mr20523423iof.225.1512854811387; Sat, 09 Dec 2017 13:26:51 -0800 (PST) Original-Received: from algol.localdomain (ip-47-212-239-173.east.us.northamericancoax.com. [173.239.212.47]) by smtp.gmail.com with ESMTPSA id x97sm2155410ita.9.2017.12.09.13.26.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 13:26:49 -0800 (PST) Original-Received: by algol.localdomain (Postfix, from userid 1000) id 344941839B1; Sat, 9 Dec 2017 16:26:48 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sat, 09 Dec 2017 16:40:27 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140876 Archived-At: 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: # 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: # 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 # Mark set Entering debugger... Back to top level Mark set # 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))