From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Shuguang Sun Newsgroups: gmane.emacs.help Subject: Re: Font setting for runemacs and frame Date: Wed, 13 Feb 2019 13:08:06 +0800 Message-ID: <21826.4975281031$1550034534@news.gmane.org> References: <83lg2louan.fsf@gnu.org> <838sykpd8a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="155486"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 13 06:08:50 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 1gtmmv-000eNZ-JL for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Feb 2019 06:08:49 +0100 Original-Received: from localhost ([127.0.0.1]:50960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtmmu-0006Ho-Cn for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Feb 2019 00:08:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtmmh-0006HX-KY for help-gnu-emacs@gnu.org; Wed, 13 Feb 2019 00:08:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtmmd-0007Fk-Iz for help-gnu-emacs@gnu.org; Wed, 13 Feb 2019 00:08:35 -0500 Original-Received: from [103.7.29.240] (port=34356 helo=smtpbg63.qq.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtmmZ-0006oz-Pl for help-gnu-emacs@gnu.org; Wed, 13 Feb 2019 00:08:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1550034490; bh=9ku/yHUK2qcgSA45n2u1z0aFKM3jIam+Jn3p+weMrRU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type; b=n2YXuVj4v8S1R54STX6p8MSfLHf9eqhS6eOehwkWKnjWaKeOmH8oJGw9uERHbEKwI fErGpcZUhTj/8Fie7grddDfSUoWQ/AItG99iv//kvE+jvDrdiX/iw3rYWoJGL7+RTQ voHfDMNdMVT2i12sPt8Z0VI8PR3lUH25jVeEI7es= X-QQ-mid: esmtp7t1550034488t5zgd3gvc Original-Received: from rshmx11052 (unknown [211.144.221.1]) by esmtp4.qq.com (ESMTP) with id ; Wed, 13 Feb 2019 13:08:07 +0800 (CST) X-QQ-SSF: 01000000000000F0F4200F00000000G X-QQ-FEAT: q17Yoz/cMVosuOlx963dW7U3R9JU1OfMm2cukoF86VKIQFz7j0esddCbNzQeR HmP+JRWlwoiu3maXCvD0wNT1naZGE6GlbZcFWXpO7PT293RxNgppeLIAKhBgPIF1IZ1bQ1M y/mdwd4C3tn38i5KnnnEQyO4lf/Lu1qlreCLs0hMpN5M/aXR2sz1vB4PbXDcJb1yulfVIWN voCmKdCoEUPEC3CO2ICLofdnjTTgb/6xZv/HSArjhQRIkIYS6PcLwUWAoDcj+9u7Kw4L8si fBTVqhdUtgvfDj6l30PWUBRyCM3PfskZbF9g== X-QQ-GoodBg: 0 In-Reply-To: <838sykpd8a.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 13 Feb 2019 05:40:53 +0200") X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:qq.com:bgweb:bgweb116 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 103.7.29.240 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:119388 Archived-At: Eli Zaretskii writes: >> From: Shuguang Sun >> Cc: help-gnu-emacs@gnu.org >> Date: Wed, 13 Feb 2019 11:27:23 +0800 >> >> Eli Zaretskii writes: >> >> > For runemacs, why don't you just use default-frame-alist? >> >> I use window-system-default-frame-alist trying to manage one dot.emacs >> for both windows box and linux. It seems both default-frame-alist and >> window-system-default-frame-alist will flush the font setting. > > Sorry, I don't think I follow: what do you mean by "flush"? Can you > show what you tried with default-frame-alist, and describe the > effects? > (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. >> I need set different font according to the fontset, and it seems neither >> default-frame-alist nor window-system-default-frame-alist is able to >> make it. > > Fontsets are the way to customize fonts more flexibly, so I don't > think I understand what you mean by "different font according to the > fontset". Again, showing what you do or tried but didn't work, will > help remove any misunderstanding. > > I'm asking all these questions because it sounds like you > unnecessarily use very complicated means, where much simpler means > exist that should allow you to do what you want. > > 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)) 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). Emacs takes font for the fontsets above according to Windows font fallbacks, e.g., MS Gothic. Finally, I find that if I put `(set-frame-font "Consolas-16" nil t)` in my dot.emacs, the font setting for above fontsets works in runemacs case without additional frame make action. -- Best Regards Shuguang Sun