Emacs gives font errors after update to 27.1

After today’s update of Emacs 27.1, I get font loading errors.

I’m using Spacemacs, which by default uses the Source Code Pro font. The font files is in ~/.local/share/fonts.

On a fresh Git checkout of Spacemacs with no user-defined configuration I get the following:

Warning (initialization): An error occurred while loading ‘/home/r********/.emacs.d/init.el’:

error: Font not available, #<font-spec nil nil Source Code Pro nil nil normal nil normal 13 nil nil nil ((:name . Source Code Pro))>


To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

However, Emacs can see the font, if I do (x-list-fonts “source code pro”) I get the following:

("-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-koi8-ru" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-koi8-r" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-9" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-7" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-5" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-4" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-3" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-2" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-16" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-15" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-13" "-adobe-source code pro-medium-r-normal--*-*-0-0-m-0-iso8859-10" ...)

This is with both the “develop” (0.300) and “master” (0.200) branches of Spacemacs. With the previous Emacs 26 packages there was no such problem.

The issue seems to be specific to the OpenSUSE package; the Spacemacs master branch in particular hasn’t changed in about a year and people have been using it with Emacs 27 before.

Update, replying to myself: this is bug https://bugzilla.opensuse.org/show_bug.cgi?id=1175372, it seems to be a bug with the OpenSUSE package.

Until a new package lands, you can follow the instructions in the first link in the bug report: edit /usr/share/X11/app-defaults/Emacs, find the line that says…

Emacs.FontBackend: xft,x

…and prefix it with !! so that it says…

!!Emacs.FontBackend: xft,x

Thank you!