11

Ok, so the problem is next, I use Liberation fonts in my XeLaTeX document:

\setmainfont{Liberation Serif}
\setsansfont{Liberation Sans}
\setmonofont{Liberation Mono}

\setmainlanguage{ukrainian}
\setotherlanguage{english}

And Liberation Serif as well as Liberation Sans work as they should. But when an error

Package polyglossia Error: The current roman font does not contain the Cyrillic script! Please define \cyrillicfont with \newfontfamily.

occurs at the very end of the document where the monospace font appears for the first time as URL.

Also my friend has no problems like this on Mac.

Is this a problem with Tex-live distribution for Linux, or a problem with Liberation Mono ?

Uko
  • 569

1 Answers1

7

Also on my machine the Liberation Mono font advertises no information about the available scripts, so Polyglossia can't activate it correctly when the current script is cyrillic.

A workaround for this is to define a \cyrillicfonttt:

\newfontfamily{\cyrillicfonttt}{Liberation Mono}

See section 4 in the documentation of Polyglossia.

Note: the error message is indeed misleading. I believe there is already a bug report filed on the development site of Polyglossia.


Added Version 2.00.1 of the Liberation fonts does not suffer from this problem, at least for the cyrillic script; the output of otfinfo -s is

% otfinfo -s LiberationMono-Regular.ttf
cyrl        Cyrillic
cyrl.MKD    Cyrillic/Macedonian
cyrl.SRB    Cyrillic/Serbian
hebr        Hebrew

while it was empty for the version the previous testing was done. The new version, released October 4, 2012, is available at https://fedorahosted.org/liberation-fonts/

egreg
  • 1,121,712
  • This is a bug of font or Polyglossia? Because you've said that Liberation Mono font advertises no information – Uko Jan 13 '13 at 07:39
  • Not of Polyglossia: the font doesn't make available the information Polyglossia needs in order to be sure that it has the cyrillic script characters. – egreg Jan 13 '13 at 10:01
  • It looks like version 2.00.1 of liberation fonts works cool – Uko Jan 14 '13 at 09:11
  • @Uko Thanks for the information. I'll test them and add to my answer. – egreg Jan 14 '13 at 10:41
  • IMO it is a Polyglossia bug, the font does not need to have OpenType Cyrillic tags to support it, unlike, say, Arabic. Either way this IMO should be a warning not an error. – خالد حسني Jan 14 '13 at 14:52
  • This answer works, but not immediately for me. It should also be mentioned that sometimes other styles have to be defined for Cyrillic too. For example, I got this problem while using the KomaScript package. It turned out that the chapter heading font was causing the problem. I had to add \newfontfamily\cyrillicfontsf{FreeSans} to fix the sans serif font. (Note the sf in cyrillicfont`) My particular problem was solved in another tex.stackexchange answer, which is related to this question. See: http://tex.stackexchange.com/questions/223327/lualatex-xelatex-with-koma-for-cyrillics – Michael F Dec 17 '15 at 19:17
  • @MichaelFranzl The question specified the mono font. – egreg Dec 17 '15 at 20:32