This example is from ScumCoder's question, based on Grigory M et al.'s answer.
If I compile the following code with XeLaTeX, all is well:
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{russian}
\setotherlanguage{english}
\setmainfont{Linux Libertine O}
\begin{document}
Привет
\begin{english}
Hello!
\end{english}
\end{document}
However, if I add a definition for \russianfont, I have problems:
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{russian}
\setotherlanguage{english}
\newfontfamily\russianfont[Script=Cyrillic]{Linux Libertine}
\setmainfont{Linux Libertine O}
\begin{document}
Привет
\begin{english}
Hello!
\end{english}
\end{document}
even though I still have \setmainfont{...} which should set the font for Russian.
In this case, XeLaTeX claims that the font does not support Cyrillic. The same happens if I switch Russian and English so that Russian is an other language (so defining \russianfont might really be needed).
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{russian}
\newfontfamily\russianfont[Script=Cyrillic]{Linux Libertine}
\begin{document}
\begin{russian}
Привет
\end{russian}
\begin{english}
Hello!
\end{english}
\end{document}
I am not certain how to tell which copy of the font XeTeX tries to use. I have this installed for both the OS and as part of TeX Live. Moreover fontconfig knows about the TeX Live directories.
fc-match -v "Linux Libertine O" returns /usr/share/fonts/otf-linux-libertine-ibx/LinLibertine_R.otf (and a bunch of information).
However, the fonts installed for TeX Live and those installed for the system appear to be identical in the case of Linux Libertine. diff -qr run on the two directories finds no differences.
What is going on and how should I be doing this?


\XeTeXtracingfonts= 1to your document to get more info about font pathes in the log. – Ulrike Fischer Jun 29 '16 at 06:49\setmainfont{Linux Libertine}is used without theO, although I'm not sure why. And I get Russian fine in that case, too. – cfr Jun 29 '16 at 15:13Oand I suggested that in my comments on the other question. (After a while, I always forget theOat first.) But I still can't really figure out what is going on. – cfr Jun 29 '16 at 22:16Linux Libertinewithout theO. Weird. – cfr Jun 29 '16 at 22:19