X-Loop: help-debbugs@HIDDEN
Subject: bug#29631: 25.3; Unable to use custom fontset as frame default font
Resent-From: Thomas Morgan <tlm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 09 Dec 2017 21:41:02 +0000
Resent-Message-ID: <handler.29631.B.151285562917647 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 29631
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 29631 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.151285562917647
(code B ref -1); Sat, 09 Dec 2017 21:41:02 +0000
Received: (at submit) by debbugs.gnu.org; 9 Dec 2017 21:40:29 +0000
Received: from localhost ([127.0.0.1]:54249 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1eNmrE-0004aQ-Se
for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 16:40:29 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57483)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <tlm@HIDDEN>) id 1eNmju-0004Pf-DV
for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 16:32:54 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <tlm@HIDDEN>) id 1eNmjn-0007FW-NU
for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 16:32:49 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level:
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
autolearn=disabled version=3.3.2
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 <tlm@HIDDEN>) id 1eNmjn-0007FO-JZ
for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 16:32:47 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48454)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from <tlm@HIDDEN>) id 1eNmjl-0006Uk-Vi
for bug-gnu-emacs@HIDDEN; Sat, 09 Dec 2017 16:32:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <tlm@HIDDEN>) id 1eNmji-0007BM-PZ
for bug-gnu-emacs@HIDDEN; Sat, 09 Dec 2017 16:32:46 -0500
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 <tlm@HIDDEN>) id 1eNmji-0007As-JB
for bug-gnu-emacs@HIDDEN; Sat, 09 Dec 2017 16:32:42 -0500
Received: by mail-io0-x233.google.com with SMTP id t196so5870171iof.0
for <bug-gnu-emacs@HIDDEN>; 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)
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 <bug-gnu-emacs@HIDDEN>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Sat, 09 Dec 2017 13:32:40 -0800 (PST)
Received: by algol.localdomain (Postfix, from userid 1000)
id 29A5C1839B1; Sat, 9 Dec 2017 16:32:39 -0500 (EST)
From: Thomas Morgan <tlm@HIDDEN>
Date: Sat, 09 Dec 2017 16:32:39 -0500
Message-ID: <87shcjsi2w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Mailman-Approved-At: Sat, 09 Dec 2017 16:40:27 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)
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:
(#<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0=
-iso10646-1">
#<font-object "-1ASC-Liberation Serif-normal-normal-normal-*-15-*-*-*-*-=
0-iso10646-1">)
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
---<fallback to the default fontset>---
[...]
(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:
(#<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0=
-iso10646-1">
#<font-object "-GNU -FreeMono-normal-normal-normal-*-40-*-*-*-m-0-iso106=
46-1">)
(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
(#<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-i=
so10646-1"> #<font-object "-GNU -FreeMono-normal-normal-normal-*-40-*-*-*-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 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))
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Thomas Morgan <tlm@HIDDEN> Subject: bug#29631: Acknowledgement (25.3; Unable to use custom fontset as frame default font) Message-ID: <handler.29631.B.151285562917647.ack <at> debbugs.gnu.org> References: <87shcjsi2w.fsf@HIDDEN> X-Gnu-PR-Message: ack 29631 X-Gnu-PR-Package: emacs Reply-To: 29631 <at> debbugs.gnu.org Date: Sat, 09 Dec 2017 21:41:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 29631 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 29631: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D29631 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN
Subject: bug#29631: 25.3; Unable to use custom fontset as frame default font
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 10 Dec 2017 17:29:01 +0000
Resent-Message-ID: <handler.29631.B29631.15129269115112 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29631
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Thomas Morgan <tlm@HIDDEN>, Kenichi Handa <handa@HIDDEN>
Cc: 29631 <at> debbugs.gnu.org
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 29631-submit <at> debbugs.gnu.org id=B29631.15129269115112
(code B ref 29631); Sun, 10 Dec 2017 17:29:01 +0000
Received: (at 29631) by debbugs.gnu.org; 10 Dec 2017 17:28:31 +0000
Received: from localhost ([127.0.0.1]:55555 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1eO5Ow-0001KO-NC
for submit <at> debbugs.gnu.org; Sun, 10 Dec 2017 12:28:31 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41090)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <eliz@HIDDEN>) id 1eO5Ou-0001KB-E5
for 29631 <at> debbugs.gnu.org; Sun, 10 Dec 2017 12:28:28 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <eliz@HIDDEN>) id 1eO5Om-00017F-31
for 29631 <at> debbugs.gnu.org; Sun, 10 Dec 2017 12:28:23 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level:
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50624)
by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
id 1eO5Ok-00015V-5r; Sun, 10 Dec 2017 12:28:18 -0500
Received: from [176.228.60.248] (port=2327 helo=home-c4e4a596f7)
by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
(Exim 4.82) (envelope-from <eliz@HIDDEN>)
id 1eO5Oj-0000Ln-Ei; Sun, 10 Dec 2017 12:28:17 -0500
Date: Sun, 10 Dec 2017 19:28:04 +0200
Message-Id: <83d13mtrvf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <87shcjsi2w.fsf@HIDDEN> (message from Thomas Morgan on Sat, 09
Dec 2017 16:32:39 -0500)
References: <87shcjsi2w.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)
> From: Thomas Morgan <tlm@HIDDEN>
> Date: Sat, 09 Dec 2017 16:32:39 -0500
>
> 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-liberation")
>
> ;; 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=40"
> 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 "ȷ" (LATIN SMALL LETTER DOTLESS J), a character in Freemono but
> ;; not in Liberation Mono.
> (list (font-at 0 nil "a") (font-at 0 nil "ȷ")))
>
> The result was this:
>
> (#<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1">
> #<font-object "-1ASC-Liberation Serif-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1">)
>
> 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-fontset-auto1
> CHAR RANGE (CODE RANGE)
> FONT NAME (REQUESTED and [OPENED])
> C-@ .. (#x43 .. #x9F)
> -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1
> .. ɏ (#xA0 .. #x24F)
> -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1
> [-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1]
> [-1ASC-Liberation Serif-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1]
> ɐ .. [#x3FFF7F] (#x250 .. #x3FFF7F)
> -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1
> [\200] .. [\377] (#x3FFF80 .. #x3FFFFF)
> -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1
>
> ---<fallback to the default fontset>---
> [...]
>
> (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-liberation")
>
> ;; 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=40"
> nil 'append)
>
> ;; Return font objects for "a", an ASCII character that Liberation Mono has,
> ;; and "ȷ" (LATIN SMALL LETTER DOTLESS J), a character in Freemono but
> ;; not in Liberation Mono.
> (list (font-at 0 nil "a") (font-at 0 nil "ȷ")))
>
> This changed the font for the non-ASCII character to Freemono
> and returned what I expected:
>
> (#<font-object "-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1">
> #<font-object "-GNU -FreeMono-normal-normal-normal-*-40-*-*-*-m-0-iso10646-1">)
>
> (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.
CC'ing Handa-san in the hope that he could provide some insights.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.