如何在Mac的Emacs上设置字体? [英] How do I set fonts on Emacs for Mac?

查看:180
本文介绍了如何在Mac的Emacs上设置字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 http://emacsformacosx.com/。它默认使用摩纳哥,我想将其更改为使用Inconsolata-dz。所以我补充说:

I downloaded Carbon emacs 23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.35) from http://emacsformacosx.com/. It defaults to using Monaco, and I would like to change it to use Inconsolata-dz. So I added:

(set-default-font "-apple-Inconsolata-dz-medium-normal-normal-*-10-*-*-*-m-0-iso10646-1")

.emacs文件。不过,在我重启之后,还是摩纳哥。它发现Option-T(或者也可能是Command-T)打开一个字体对话框,如果我选择了Inconsolata-dz,它的效果很好。但是如果我重新启动,那就回到摩纳哥了。所以我尝试从菜单中设置字体,然后进入自定义面孔并保存,但仍然不起作用。有趣的是,如果在从Option-T对话框中更改字体后,我使用Mx描述字体,则会显示-apple-Inconsolata-dz-medium-normal-normal- -10 - - * - * - m-0-iso10646-1。

to my ~/.emacs file. However, after I restart, it is still Monaco. It discovered that Option-T (or maybe Command-T) brings up a font dialog, and if I select Inconsolata-dz from that, it works great. But if I restart, it is back to Monaco. So I tried setting the font from the menu, and then going to Customize Faces and saving it, but still it does not work. The interesting thing is that if I do M-x describe-font after changing the font from the Option-T dialog, it says -apple-Inconsolata-dz-medium-normal-normal--10--*-*-m-0-iso10646-1.

所以看起来Emacs只是因为某些原因忽略了这个字体。为什么会这样,我该怎么办才能使用这种字体?

So it looks like Emacs is simply ignoring this font for some reason. Why is that, and what can I do to get it to use this font?

更新:我尝试了Donkopotamus和Joost Diepenaat的建议,但是他们也没有工作,虽然我最终得到Times作为我的字体,而不是摩纳哥。但是,如果我使用Inconsolata(不是Inconsolata-dz),它们会很好用。所以我想知道在名字中有短划线的字体是否有问题?

Update: I tried Donkopotamus and Joost Diepenaat's recommendations and they also did not work, although I ended up getting Times as my font, instead of Monaco. However, they work great if I just use the Inconsolata (not Inconsolata-dz). So I'm wondering if there is some problem with fonts with a dash in their name?

Update2:为什么这个偏离主题?最近的消息是以某种方式问题[应该...]与编程或软件开发有关;许多开发人员使用emacs,并且正确设置设置很重要。搜索编程字体的前两个条目组合了150个;所以字体配置似乎对程序员很重要。无论如何,如果它是偏离主题,哪里是适当的地方发布?

Update2: Why is this off-topic? The close message says "questions [should ...] relate to programming or software development in some way"; many developers use emacs, and getting settings right is important. The top two entries on a search for "programming fonts" have a combined 150; so font configs seem to be important to programmers. Anyway, if it is off-topic, where is the appropriate place to post it?

推荐答案

我使用普通的Inconsolata。从我的emacs.d / init.el:

I use plain Inconsolata. From my emacs.d/init.el:

(set-face-attribute 'default nil
                    :family "Inconsolata" :height (case system-type
                                                    ('gnu/linux 130)
                                                    ('darwin 145)) :weight 'normal)

如果您只在OSX上运行,可以简化为

If you're only running on OSX, you can simplify that to

(set-face-attribute 'default nil
                    :family "Inconsolata" :height 145 :weight 'normal)

这篇关于如何在Mac的Emacs上设置字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆