[Tex/LaTex] XeTeX can’t find font

fontsfontspecxetex

I'm using fontspec with XeTeX from TL2010. I've installed the Linux Libertine OTF font files in /usr/local/share/fonts, ran fc-cache and I can see them listed:

$ fc-list | grep -i libert
Linux Libertine Slanted O:style=Slanted
Linux Libertine Slanted O:style=Semibold Slanted
Linux Libertine O:style=Bold Italic
Linux Libertine Capitals O:style=Semibold Italic Samll Caps
Linux Libertine O C:style=Regular
Linux Libertine O:style=Regular
Linux Libertine Capitals O:style=Semibold Small Caps
Linux Libertine O:style=Semibold Italic
Linux Libertine Display Capitals O:style=Small Caps
Linux Libertine O:style=Italic
Linux Libertine Initials O:style=Initials
Linux Libertine O:style=Semibold
Linux Libertine Capitals O:style=Bold Small Caps
Linux Libertine Display O:style=Regular
Linux Libertine Capitals O:style=Italic
Linux Libertine Slanted O:style=Bold Slanted
Linux Libertine O:style=Bold
Linux Libertine Capitals O:style=Bold Italic Samll Caps
Linux Libertine Capitals O:style=Small Caps

Now when I try to use:

\newfontfamily\headerfont{Linux Libertine Slanted O}

fontspec says it can't find the font:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 
! fontspec error: "font-not-found"
! 
! The font "Linux Libertine Slanted O" cannot be found.
! 
! See the fontspec documentation for further information.
! For immediate help type H <return>.
!...............................................  

l.13 ...mily\headerfont{Linux Libertine Slanted O}

The very same steps work perrfectly on another machine using TL2009 from standard Ubuntu packages.

Best Answer

You don't need to copy fonts that are already in TeX Live in system directories; you can simply do the following steps from a terminal window (assuming a bash shell):

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

The whole system will know those fonts just as if they were in system directories (for programs linked with the fontconfig library, of course).

After installing TeX Live 2011 (after it has been released), you should issue the same two commands and fonts from the new release will be used.