I'm trying to customize fonts on Emacs with
(custom-theme-set-faces
'user
`(org-level-1 ((t (:font "STIXIntegralsUp")))))
but it says "Font not available", despite STIXIntegralsUp being one of the fonts listed by (font-family-list)
. It only seems to work when I pass it the name or XLFD string of a font visible to xfontsel
, but that excludes a lot of fonts installed on my system. In fact, if I go to the GUI menu and click Options > Set Default Font... and pick any named font (I tried about a dozen of them), it will say "Font not available". How can this be? Emacs can't use the output of a font selection dialog that it created?
I'm at a loss here. Does this sound like a Emacs config problem? OS font subsystem problem? Or am I just misusing font specs? I'm a long-time Emacs user, but I've always avoided its messy font subsystem, so I might be just missing something really basic.
I'm on Ubuntu 21.10 with Emacs installed through apt. I did try invoking emacs with --no-init
. system-configuration-options
is
--build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/lib --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man
--enable-libsystemd --with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --build
x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/lib --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man
--enable-libsystemd --with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --with-cairo
--with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
'CFLAGS=-g -O2
-ffile-prefix-map=/build/emacs-P5Mppj/emacs-27.1+1=. -fstack-protector-strong
-Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
-D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions
-Wl,-z,relro'
:font
expects? (I don't know, but that's where I'd start looking...):font
expects either, but both of them give "Font not available"."-*-Lucida Console-normal-r-*-*-14-*-*-*-c-*-iso8859-1"
. But I'm only guessing at what the function expects. (What does its doc or code tell you?) In general, a font family name is not the same as a font name, I believe.M-: (frame-parameter nil 'font-backend)
give you? If it's only 'x', then you have something disabling the FreeType font backend, maybe something in .Xdefaults. You can tryemacs -Q
, that will disable loading X resources as well.