From: Shuguang Sun <shuguang79@qq.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Font setting for runemacs and frame
Date: Thu, 14 Feb 2019 23:28:08 +0800 [thread overview]
Message-ID: <35790.6146253058$1550159077@news.gmane.org> (raw)
In-Reply-To: <83lg2io1hi.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Feb 2019 17:04:25 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Shuguang Sun <shuguang79@qq.com>
>> 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?
Years ago, it didn't work for server or daemon, and I tried the hook way.
Now it seems to work well.
>
>> 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.
>
>
Thanks! Now I understand.
--
Best Regards
Shuguang Sun
next prev parent reply other threads:[~2019-02-14 15:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 10:03 Font setting for runemacs and frame Shuguang Sun
2019-02-12 16:17 ` Eli Zaretskii
2019-02-13 3:27 ` Shuguang Sun
[not found] ` <vk5yimxo9xlw.fsf@qq.com>
2019-02-13 3:40 ` Eli Zaretskii
2019-02-13 5:08 ` Shuguang Sun
[not found] ` <vk5ybm3g2s3t.fsf@qq.com>
2019-02-14 15:04 ` Eli Zaretskii
2019-02-14 15:28 ` Shuguang Sun [this message]
2019-02-14 15:40 ` Robert Pluim
2019-02-14 17:01 ` Eli Zaretskii
2019-02-14 17:14 ` Robert Pluim
2019-02-15 9:57 ` Robert Pluim
2019-02-15 10:01 ` Shuguang Sun
2019-02-16 3:11 ` next new frame's height after initial frame (Was: Font setting for runemacs and frame) Van L
[not found] ` <vk5yimxl1ibv.fsf@qq.com>
2019-02-15 14:24 ` Font setting for runemacs and frame Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2019-02-12 10:03 Shuguang Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='35790.6146253058$1550159077@news.gmane.org' \
--to=shuguang79@qq.com \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).