From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Font setting for runemacs and frame Date: Thu, 14 Feb 2019 17:04:25 +0200 Message-ID: <83lg2io1hi.fsf@gnu.org> References: <83lg2louan.fsf@gnu.org> <838sykpd8a.fsf@gnu.org> +94129D39FD882F57 Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="63727"; mail-complaints-to="usenet@blaine.gmane.org" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 14 16:17:41 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guIlf-000GRq-RS for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 16:17:39 +0100 Original-Received: from localhost ([127.0.0.1]:50053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guIle-0005Vj-P7 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 10:17:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guIgw-0002W2-Qb for help-gnu-emacs@gnu.org; Thu, 14 Feb 2019 10:12:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guIYy-0004JZ-6X for help-gnu-emacs@gnu.org; Thu, 14 Feb 2019 10:04:33 -0500 Original-Received: from [176.228.60.248] (port=2244 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1guIYx-0003Wi-DD for help-gnu-emacs@gnu.org; Thu, 14 Feb 2019 10:04:32 -0500 In-reply-to: +94129D39FD882F57 (message from Shuguang Sun on Wed, 13 Feb 2019 13:08:06 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119401 Archived-At: > From: Shuguang Sun > Cc: help-gnu-emacs@gnu.org > Date: Wed, 13 Feb 2019 13:08:06 +0800 > > (cl-pushnew '(w32 (font . "Consolas-16")) > window-system-default-frame-alist) > > or > > (add-to-list 'default-frame-alist '(font . "Consolas-16")) > > To set the default font as Consolas-16 in w32 system. This will only work for frames other than the first frame. > To specify font for fontset, cjk etc., I use the code below and actually > make it a function and call it in after-make-frame-functions (new frame > in daemon mode) or call it after-init-hook (intended for runemacs with > `if (not (daemonp))`). > > (dolist (charset '(kana han cjk-misc bopomofo chinese-gbk gb18030)) > (set-fontset-font nil charset > (font-spec :family "Microsoft Yahei") > nil 'prepend)) Why do you need to call this in a hook? Why not just at top level of your .emacs file? > However with the setting of window-system-default-frame-alist or > default-frame-alist above, it takes no effect until I make a new frame > (after-make-frame-functions). This is documented behavior: to modify the looks ofg the first frame, you need to set initial-frame-alist in addition to default-frame-alist.