help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font setting for runemacs and frame


From: Eli Zaretskii
Subject: Re: Font setting for runemacs and frame
Date: Thu, 14 Feb 2019 17:04:25 +0200

> 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?

> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]