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#29631: 25.3; Unable to use custom fontset as frame default font Date: Sat, 09 Dec 2017 16:32:39 -0500 Message-ID: <87shcjsi2w.fsf@ziiuu.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1512855678 16504 195.159.176.226 (9 Dec 2017 21:41:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2017 21:41:18 +0000 (UTC) To: 29631@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 09 22:41:13 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 1eNmrw-00041V-VT for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Dec 2017 22:41:13 +0100 Original-Received: from localhost ([::1]:42647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNms0-0000dG-SC for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Dec 2017 16:41:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNmrr-0000cn-DK 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 1eNmrn-0003z2-2a for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:41:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNmrm-0003yx-VI for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:41:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eNmrm-0004bn-Ox 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:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29631 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.151285562917647 (code B ref -1); Sat, 09 Dec 2017 21:41:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Dec 2017 21:40:29 +0000 Original-Received: from localhost ([127.0.0.1]:54249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNmrE-0004aQ-Se for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:40:29 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNmju-0004Pf-DV for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:32:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNmjn-0007FW-NU for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:32:49 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58232) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNmjn-0007FO-JZ for submit@debbugs.gnu.org; Sat, 09 Dec 2017 16:32:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNmjl-0006Uk-Vi for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:32:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNmji-0007BM-PZ for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:32:46 -0500 Original-Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]:33043) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNmji-0007As-JB for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 16:32:42 -0500 Original-Received: by mail-io0-x233.google.com with SMTP id t196so5870171iof.0 for ; Sat, 09 Dec 2017 13:32:42 -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 :content-transfer-encoding; bh=I7l/tMH9ObUBSiJWMa2Rs6ElQjBcemR2TkfegoWmMfk=; b=tNjvQCiVFVztIzCvcoivl3aPXf2KpnPoPzC6wr5bRXzvnkLlqBd7vmhaRTi6vs/UUD ZzqvF1h/Z5ES0dWg3z8IQNz/6PtndqckiBYdNAtUoLEkcAduksrOMhnmjaZUaK1uEqa2 UnPvNFoeRneISjjk/5x4hKYif6+r3moVfhbYasu4jfRDcuHKdG+bdiIVT6q6MtxakZB1 Qk8XOol6k8sH6ozanACUsCuFrjHcdw9i+SePvbjLlAaiyW8lYxoNerR0p8FepoU5yH5c vhC++rYuOnOoAnQz5xRRyPzInuZoXv6b+dwFytu7N4ZLtqsaFUqQsKLDbyW6wvJDqdPY FSvg== 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 :content-transfer-encoding; bh=I7l/tMH9ObUBSiJWMa2Rs6ElQjBcemR2TkfegoWmMfk=; b=DSEqBWRbS/IGcPbbrm5tmHGLIZ8Ft8sfZubi/w+mP+Q9IA1yI/8trYZL1mP0Cter7v pY1ocxRDIEdXQF53EMKwDnQSiFZykkhHGDH0Evabwmdkhk5+gMpD/ybBk7p/JFpXPT2n /xb/cFroQmDSOh1VK/u53gL10BrUaXrjVbhtGK+ovvQeyiebrUXfDizLi9sIii0Q4S7g OBrMveaanXgIRXCyAseAdzI+D/c9zINOrhJYzFMWxj9OQxDihpJ57NXEY0ji1l7JNwvD KUOEJXFoPHvVaGYYysohtfBZVKD4pHmhIDJGNbtEpheHYOvq5oppaOO70y905BFudJkS WKSA== X-Gm-Message-State: AKGB3mKx/RqnA4iegakLdbAEiUC2L/Lw6DKtKkR+eXoAiyAs7G0GLh7V 5Sm2ijt+qaUEisIiHxFp8gyEXWlW X-Google-Smtp-Source: AGs4zMZY90s9EUn5YZxJmBKdz9gMKFo30hWnh0hwX5RBK4+GAlGfXJNM4IMr9ZSEf8BpvFahUmliJA== X-Received: by 10.107.147.214 with SMTP id v205mr21712281iod.25.1512855161216; Sat, 09 Dec 2017 13:32:41 -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 y133sm2134555itf.7.2017.12.09.13.32.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 13:32:40 -0800 (PST) Original-Received: by algol.localdomain (Postfix, from userid 1000) id 29A5C1839B1; Sat, 9 Dec 2017 16:32:39 -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:140874 Archived-At: I started Emacs with `emacs -Q', entered the following expression in *scratch*, and evaluated it with C-M-x: (progn ;; Create a new fontset called fontset-liberation. (create-fontset-from-fontset-spec "-*-Liberation Mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-liberat= ion") ;; Set its primary font to Liberation Mono. (set-fontset-font "fontset-liberation" 'unicode-bmp "Liberation Mono") ;; Add a fallback to Freemono for characters that Liberation Mono lacks. (set-fontset-font "fontset-liberation" 'unicode-bmp "Freemono:size=3D40" nil 'append) ;; Set the frame's default font to the new fontset. (set-face-font 'default "fontset-liberation") ;; Return font objects for "a", an ASCII character that Liberation Mono= has, ;; and "=C8=B7" (LATIN SMALL LETTER DOTLESS J), a character in Freemono= but ;; not in Liberation Mono. (list (font-at 0 nil "a") (font-at 0 nil "=C8=B7"))) The result was this: (# #) The font for ASCII character "a" was Liberation Mono as expected, but I expected the second font to be Freemono and it was Liberation Serif. I checked which fontset is being used as default: (face-attribute 'default :fontset) It's fontset-auto1, not fontset-liberation: "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-fontset-auto1" I typed `M-x describe-fontset RET fontset-auto1 RET'. Fontset: -1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-fontse= t-auto1 CHAR RANGE (CODE RANGE) FONT NAME (REQUESTED and [OPENED]) C-@ .. =C2=9F (#x43 .. #x9F) -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1 =C2=A0 .. =C9=8F (#xA0 .. #x24F) -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1 [-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso106= 46-1] [-1ASC-Liberation Serif-normal-normal-normal-*-15-*-*-*-*-0-iso10= 646-1] =C9=90 .. [#x3FFF7F] (#x250 .. #x3FFF7F) -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1 [\200] .. [\377] (#x3FFF80 .. #x3FFFFF) -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1 ------ [...] (Non-UTF8 characters are replaced with representations in brackets.) So fontset-auto1 includes Liberation Serif but not Freemono. fontset-auto1 seems to be generated from fontset-liberation's primary font without regard for its fallback fonts. To test whether changing the fallback font in fontset-auto1 has an effect, I restarted Emacs with `emacs -Q' and evaluated the following expression, which modifies fontset-auto1 instead of fontset-liberation. (progn ;; Create a new fontset called fontset-liberation. (create-fontset-from-fontset-spec "-*-Liberation Mono-normal-normal-normal-*-*-*-*-*-m-0-fontset-liberat= ion") ;; Set the frame's default font to the new fontset. (set-face-font 'default "fontset-liberation") ;; Set the frame's primary font to Liberation Mono. (set-fontset-font "fontset-auto1" 'unicode-bmp "Liberation Mono") ;; Add a fallback to Freemono for characters that Liberation Mono lacks. (set-fontset-font "fontset-auto1" 'unicode-bmp "Freemono:size=3D40" nil 'append) ;; Return font objects for "a", an ASCII character that Liberation Mono= has, ;; and "=C8=B7" (LATIN SMALL LETTER DOTLESS J), a character in Freemono= but ;; not in Liberation Mono. (list (font-at 0 nil "a") (font-at 0 nil "=C8=B7"))) This changed the font for the non-ASCII character to Freemono and returned what I expected: (# #) (Incidentally, evaluating the above progn without restarting Emacs causes a core dump, but I have a smaller test case for that and I'll make another report about it.) It looks as if fontset-auto1 is generated by fontset_from_font in fontset.c, but I don't understand why the specified fontset (fontset-liberation) is not used and I haven't been able to find anything in the manual that clarifies this behavior. I'd like to know how to use a custom fontset for a frame's default face (and for other faces), but if that's not supported, this may be a documentation bug. 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=3D/nix/store/7px74nmmy9wnl594jsk0lcgz1ygsbwfj-emacs-25.3 --with-modules --with-x-toolkit=3Dgtk3 --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=3Dibus 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 (# #) 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 help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils 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 87168 5967) (symbols 48 19960 0) (miscs 40 56 121) (strings 32 14566 4561) (string-bytes 1 435478) (vectors 16 11914) (vector-slots 8 439170 4779) (floats 8 166 74) (intervals 56 242 21) (buffers 976 18))