5

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?

Logan S.
  • 181
  • 1
  • 7
  • Cross posted from https://stackoverflow.com/questions/44332322/what-is-the-proper-way-to-identify-a-font-for-spacemacs-file – Logan S. Jun 02 '17 at 17:55

1 Answers1

3

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!

Logan S.
  • 181
  • 1
  • 7