简体   繁体   中英

Emacs `Invalid font name`

I am using GNU Emacs 24.3.1 (x86_64-suse-linux-gnu, GTK+ Version 3.6.4). I have custom font Inconsolata-g in my ~/.fonts folder, and I have set it as Monospace font in ~/.config/fontconfig/fonts.conf . It works well except Emacs is giving me error: Invalid font name, -unknown-Inconsolata-g-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 at launch.

If I change monospace font, then Emacs launch without problem, but when I do Mx set-default-font , and select -unknown-Inconsolata-g-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1 , I also get Invalid font name: "-unknown-Inconsolata-g-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" .

How could i fix this?

Thanks to Peter Dyballa ( http://lists.gnu.org/archive/html/help-gnu-emacs/2013-06/msg00347.html ), I fixed this with the following in my ~/.emacs :

 (setq initial-frame-alist '(
   (font . "Monospace-10")
 ))
 (setq default-frame-alist '(
   (font . "Monospace-10")
 ))

(I have set Monospace to Inconsolata-g in my system settings)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM