Emacs字体配置问题。

Vim、Emacs配置和使用
回复
头像
tosail2010
帖子: 83
注册时间: 2011-03-27 19:01
联系:

Emacs字体配置问题。

#1

帖子 tosail2010 » 2011-11-18 17:26

.emacs文件一段配置如下

代码: 全选

(set-frame-font "YaHei Consolas:pixelsize=18")
但是运行emacs 文件名 时,显示

代码: 全选

Warning (initialization): An error occurred while loading `/home/tosail/.emacs':

error: Font `YaHei Consolas:pixelsize=18' is not defined

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.
但是我在/usr/share/fonts/truetype/目录下安装了这个字体
-rw-r--r-- 1 root root 14476528 2011-11-18 17:02 YaHei.Consolas.1.11b.ttf
lrwxrwxrwx 1 root root 24 2011-11-18 17:05 YaHei_Consolas.ttf -> YaHei.Consolas.1.11b.ttf

这是为什么呢
A year's plan starts with spring.
头像
anix
帖子: 88
注册时间: 2009-05-18 22:33
联系:

Re: Emacs字体配置问题。

#2

帖子 anix » 2011-11-19 0:59

确认fc-list下是否有该字体。
如:(set-default-font "微软雅黑-13")
另外目前emacs可以分别设置中英文字体,如:

代码: 全选

;(set-frame-font  "Cosolas-14");这里还是推荐在window-system-default-frame-alist里设置
(set-fontset-font "fontset-default" 'han '("Microsoft YaHei"."unicode-bmp"));设置汉语字体
I firmly believe that the Internet and knowledge should be open, public, and accessible to everyone without any restrictions.
头像
tosail2010
帖子: 83
注册时间: 2011-03-27 19:01
联系:

Re: Emacs字体配置问题。

#3

帖子 tosail2010 » 2011-11-19 10:13

fc-list 后,发现没有这种字体。
如何添加进去呢?
A year's plan starts with spring.
头像
tosail2010
帖子: 83
注册时间: 2011-03-27 19:01
联系:

Re: Emacs字体配置问题。

#4

帖子 tosail2010 » 2011-11-19 14:03

anix 写了:确认fc-list下是否有该字体。
如:(set-default-font "微软雅黑-13")
另外目前emacs可以分别设置中英文字体,如:

代码: 全选

;(set-frame-font  "Cosolas-14");这里还是推荐在window-system-default-frame-alist里设置
(set-fontset-font "fontset-default" 'han '("Microsoft YaHei"."unicode-bmp"));设置汉语字体
Consolas-14 与Consolas:pixelsize=14 字体大小不一样, 区别是什么?
A year's plan starts with spring.
回复