[Tex/LaTex] Problem with babel and fontspec

babelfontspec

I've just had a problem on using babel with lualatex (or xelatex as well) and fontspec in the context of latin and cyrillic alphabets. Here is a minimal example:

\documentclass[11pt]{article}

\usepackage{fontspec}
\setmainfont{Heuristica}%
\usepackage[english,russian]{babel}
\newcommand*\English{\selectlanguage{english}}

\begin{document}

\textup{\Russian Мороз и солнце, день чудесный}

\English\textit{The sea is calm to-night.}
\end{document} 

And here's the resulting .pdf:

enter image description here

As one can see, the font used for the English part of the text is Computer Modern, not Heuristica, and there's not even italic where it's supposed to be italic.

However, if I change the order of the languages ([russian, english], everything is fine:

enter image description here

If I compile with pdflatex, modifying accordingly the preamble and using the type 1 versions of the fonts instead of the opentype, everything is fine whatever the order of the languages. I tried with some other fonts, same problem. Is this a bug or do I miss something?

Best Answer

egreg's answer now explains why this works which I didn't understand when I posted it as a comment.

If you load fontspec after babel, then it all works:

\documentclass[11pt]{article}

\usepackage[british,russian]{babel}
\newcommand*\English{\selectlanguage{british}}
\usepackage{fontspec}
\setmainfont{Heuristica}%
\usepackage{poetrytex}

\begin{document}

\renewcommand{\poetryheadings}{\pagestyle{myheadings} \markboth{}{}}
\English
\begin{poem}{Title}{Author\\2014}
\textup{\Russian Мороз и солнце, день чудесный}\\
\textit{The sea is calm to-night.}
\end{poem}

\end{document}

Heuristica

But note that the fontspec manual describes babel as 'not really supported' and recommends polyglossia (page 4). I assume they mean for languages supported by the latter which is not all of them but does include Russian.

Related Question