raawaa
V2EX  ›  Emacs

在 emacsclient 中应用中文字体设置

  •  
  •   raawaa · Mar 1, 2016 · 3007 views
    This topic created in 3761 days ago, the information mentioned may be changed or developed.

    daemon 模式下用emacsclient -c发现字体设置没有生效,折腾一番之后发现如下方法:

    ;;; 设置中文字体
    (defun my-apply-font ()
      (set-default-font "Consolas")
      (set-fontset-font "fontset-default" 'chinese-gbk "微软雅黑")
    
      (setq face-font-rescale-alist '(("宋体" . 1.2)
                                      ("微软雅黑" . 1.1)
                                      )))
    (my-apply-font)
    ;;; 使字体设置应用到 client 中
    (add-hook 'after-make-frame-functions
              (lambda (frame)
                (select-frame frame)
                (my-apply-font)))
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1021 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 23:12 · PVG 07:12 · LAX 16:12 · JFK 19:12
    ♥ Do have faith in what you're doing.