3

Spacemacs isn't finding my Source Code Pro font files, and I think it's a naming issue. I have the fonts installed and in the font cache,

/usr/local/share$ fc-list : file | grep source

Returns:

/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Bold.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-It.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-BlackIt.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-BoldIt.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Medium.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-ExtraLight.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-LightIt.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Semibold.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-MediumIt.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Black.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Light.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-SemiboldIt.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-ExtraLightIt.otf: 
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Regular.otf: 

But every time I load up spacemacs it returns the error:

Cannot find any of the specified fonts (adobe-source-code-pro)! Font settings
  may not be correct.  

In my .spacemacs file, I have

dotspacemacs-default-font '("adobe-source-code-pro"
                               :size 13
                               :weight normal
                               :width normal
                               :powerline-scale 1.1)

What can I change so that spacemacs will correctly find my fonts?

2

It wasn't a naming issue, it was a dependency issue possibly related to me using Red Hat Fedora. I was missing the liboft-dev library emacs needs to read .otf files, which are separate from the liboft libraries in Red Hat.

When looking at the ./configuration output, it stated:

Does Emacs use -lfreetype?                              no
Does Emacs use -lm17n-flt?                              no
Does Emacs use -lotf?                                   no
Does Emacs use -lxft?                                   no 

After adding the dependency and re-making, the fonts are correctly recognized under the name "Source Code Pro", which is most likely defined in the .otf file, despite it having a different name.

My .spacemacs file now reads

dotspacemacs-default-font '("adobe-source-code-pro"
                               :size 13
                               :weight normal
                               :width normal
                               :powerline-scale 1.1)

and all the errors are gone. Hope this fixes your problem too!

  • 1
    What gave you ./configuration output? How did you "add the dependency," and then "re-make?" – Caleb Jay Feb 11 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.