Win10版emacs中icon乱码的问题

从windows安装好emacs27.1之后,icon的展示出现乱码:

Win10版emacs中icon乱码的问题

doom-emacs

Emacs版本如下:

gaowei@alpha:/mnt/c/Users/gaowei$ emacs.exe --version
GNU Emacs 27.1
Copyright (C) 2020 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

1.问题分析

问题的症结在于all-the-icons吗?

Win10版emacs中icon乱码的问题

已经成功的安装,那么问题在哪里呢?搜到要安装symbola的解决方案。

Win10版emacs中icon乱码的问题

原因在于Emacs默认有fall-back到Symbola字体。

2.安装Symbola字体

安装symbola字体

Win10版emacs中icon乱码的问题

安装好之后,修改配置:

(set-fontset-font t nil "Symbola" nil 'prepend)

之后运行函数:

(font-family-list)

查看是否安装成功。

然而,问题依旧。

3.关闭cn-fonts

还剩下的问题是cn-fonts,作者已经停止维护,从配置中关闭:

;;(require 'cnfonts)
;;(cnfonts-enable)
;; Auto generated by cnfonts

并重新设置字体。

(set-fontset-font t nil "Symbola" nil 'prepend)
(set-face-attribute
 'default nil
 :font (font-spec :name "Monaco" 
                  :weight 'normal
                  :slant 'normal
                  :size 12.5))
(dolist (charset '(kana han symbol cjk-misc bopomofo))
  (set-fontset-font
   (frame-parameter nil 'font)
   charset
   (font-spec :name "KaiTi"
              :weight 'normal
              :slant 'normal
              :size 15.0)))


4.验证安装效果

低栏的视图:

Win10版emacs中icon乱码的问题

doom-emacs首页的视图:

Win10版emacs中icon乱码的问题

以上配置完毕,问题解决。

展开阅读全文

页面更新:2024-03-03

标签:症结   乱码   视图   首页   函数   字体   解决方案   原因   效果   版本   作者   科技

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号

Top