[Tex/LaTex] Spaces in font names


I have an updated TeX Live distribution.

Following Fonts for PolyTonic Greek I copied the code exactly:

  #1\\{\fontspec{#1}Βίβλος γενέσεως Ἰησοῦ Χριστοῦ υἱοῦ Δαυὶδ υἱοῦ Ἀβραάμ.}
\test{CMU Serif}
\test{EB Garamond}
\test{GFS Artemisia}
\test{GFS Baskerville}
\test{GFS Bodoni}
\test{GFS Complutum}
\test{GFS Didot}
\test{GFS Olga}
\test{GFS Porson}
\test{GFS Solomos}
\test{Linux Libertine O}
\test{Old Standard}

into c.tex and then did xelatex c. This returned the following error:

Invalid fontname `CMU Serif', contains ' '

fontspec error: "font-not-found" l.14 \test{CMU Serif}

Thus its first objection is to a space in a font name. How can that linked example work with a whole list of fonts with spaces in their names? And it also appears that no font whose name contains the strings "Serif" and "CMU" is part of TeX Live 2013:

find /usr/local/texlive -type f | egrep -i serif | egrep -i cmu

What am I missing?

Best Answer

The error is not really due to a space in the font name, but rather in the fact that the font “CMU Serif” is not available as a system font.

On a GNU/Linux box with TeX Live, the simplest way to make all fonts in TeX Live available to the system is to copy the pointers to the font directories to /etc/fonts/conf.d and do fc-cache:

sudo cp $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
sudo fc-cache -fsv

Just tried on a GNU/Linux box and here's the output:

enter image description here

Related Question