How to set a frame font in Emacs

I want to change the font in Emacs from native mode. I am using Emacs 24.3 on Ubuntu 12.04.

I tried set-frame-fontfor example:

(set-frame-font "DejaVu Sans Mono-10")

But I get the error:

Debugger entered--Lisp error: (error "Font not available" #<font-spec nil nil DejaVu\ Sans\ Mono nil nil nil nil nil 10.0 nil nil nil ((:name . "DejaVu Sans Mono-10") (user-spec . "DejaVu Sans Mono-10"))>)
  internal-set-lisp-face-attribute(default :font "DejaVu Sans Mono-10" #<frame emacs-24.3@cipr064219.klientdrift.uib.no 0x116a4c0>)

Conclusion fc-list:

fc-list | grep 'DejaVu Sans Mono'

DejaVu Sans Mono:style=Bold Oblique
DejaVu Sans Mono:style=Oblique
DejaVu Sans Mono:style=Book
DejaVu Sans Mono:style=Bold
+4
source share
1 answer

It looks like you created Emacs without Xft support , which is required if you want to use antialiased, TrueType, and OpenType fonts.

Here is how you can build it with Xft:

Emacs TrueType OpenType, DejaVu Sans Mono.

+3

Source: https://habr.com/ru/post/1534390/


All Articles