[英]Cocoa Emacs 24.5 Font Issues Invalid Font Name (Inconsolata-dz)
I am trying to set [Inconsolata-dz][1] as my default font to Emacs. 我正在尝试将[Inconsolata-dz] [1]设置为Emacs的默认字体。 Regular Inconsolata works fine, but the dz version is not working properly.
常规Inconsolata可以正常工作,但是dz版本无法正常工作。 Most functions I use keep throwing this error (followed all the instructions online on how to set Emacs font):
我使用的大多数功能都会抛出此错误(在线上有所有有关如何设置Emacs字体的说明):
set-face-attribute: Invalid font name: "-*-Inconsolata-dz-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1"
I finally got it to work by doing this in my init.el
: 我终于在
init.el
通过以下操作使其工作:
(setq initial-frame-alist '((font . "Inconsolata-dz-13")))
(setq default-frame-alist '((font . "Inconsolata-dz-13")))
I also have this in init.el
, which was generated by customize-faces
, but it seems to change the font to Helvetica (unless overridden by the code above): 我在
init.el
也有此init.el
,它是由init.el
customize-faces
生成的,但是它似乎将字体更改为Helvetica(除非被上面的代码覆盖):
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
(quote
("e16a771a13a202ee6e276d06098bc77f008b73bbac4d526f160faa2d76c1dd0e"
"d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879"
"8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4"
default))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :inverse-video nil
:box nil :strike-through nil :overline nil
:underline nil :slant normal
:weight normal :height 140 :width normal
:foundry "nil" :family "Inconsolata-dz")))))
Now the issue with the first code above is that doing a Ctrl+N
, to create a new window will throw the same Invalid font name error. 现在,上面第一个代码的问题是,执行
Ctrl+N
来创建新窗口将引发相同的无效字体名称错误。
I installed Inconsolata and Inconsolata-dz the same way on my Mac. 我在Mac上以相同的方式安装了Inconsolata和Inconsolata-dz。 Just the regular, default way of installing fonts on OS X.
只是在OS X上安装字体的常规默认方法。
Does anyone know what I'm doing wrong and how I can use Inconsolata-dz properly? 有谁知道我在做什么错以及如何正确使用Inconsolata-dz?
Recent versions of emacs seem to have issues with dashes in font names. emacs的最新版本似乎在字体名称中出现破折号。
This solution fixed it for me: 此解决方案为我解决了这个问题:
https://emacs.stackexchange.com/questions/16818/cocoa-emacs-24-5-font-issues-inconsolata-dz/29397#29397 https://emacs.stackexchange.com/questions/16818/cocoa-emacs-24-5-font-issues-inconsolata-dz/29397#29397
Basically had to rename the font to InconsolataDZ. 基本上必须将字体重命名为InconsolataDZ。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.