2

MWE:

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian, english]{babel}
\usepackage{droid}
\begin{document}
Some meaningful text.

Какой-то осмысленный текст.
\end{document}

When I run:

$ xelatex temp.tex 

It shows this:

enter image description here

The problem is missing Russian glyphs in the font. I can use the Arian font and it will work:

\setmainfont{Arial Unicode MS}

But I don't like how it looks. Is it possible to use some Latex fonts instead? I read this discussion: What fonts are compatible with T2A (Cyrillic) encoding?, and saw that the author said "This fonts are great (especially droid, for me).". I tried to use droid package, but it doesn't work for me.

How to use the fonts with cyrillic support, shipped with TeX Live in xelatex?

Update

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[russian, english]{babel}
\usepackage{fontspec}
\usepackage[T2A]{fontenc}
\usepackage[default]{droidserif}
\usepackage[defaultsans]{droidsans}
\begin{document}
Some meaningful text.

Какой-то осмысленный текст.
\end{document}
user4035
  • 5,035
  • 6
  • 40
  • 57
  • \usepackage[T2A]{fontenc} should not be used with xelatex. If you want to use xelatex use fontspec and \setmainfont. If you don't like Arial find another one. – Ulrike Fischer Apr 23 '20 at 08:35
  • @UlrikeFischer "If you don't like Arial find another one." - is it possible to use fonts shipped with Latex or only those installed in my system? – user4035 Apr 23 '20 at 09:03
  • You can use all fonts in fonts/opentype and fonts/truetype in your tex system, but I don't know which of them support cyrillic. You will have to check. – Ulrike Fischer Apr 23 '20 at 09:07
  • @UlrikeFischer egreg in his answer gives a listing of fonts. He mentions droid package. How to use them? ``\usepackage{droid}` doesn't work. – user4035 Apr 23 '20 at 09:23
  • Hm. This package is not completly bugfree, droidmono seems to be missing. Try \usepackage[default]{droidserif}\usepackage[defaultsans]{droidsans} and report the error to the maintainer. – Ulrike Fischer Apr 23 '20 at 09:30
  • @UlrikeFischer I updated the question. It still uses computer modern font and doesn't show the Russian text. Can you reproduce it on your machine? Can you give an answer with example of the working code? – user4035 Apr 23 '20 at 09:32
  • Also I saw an advice to use cm-unicode fonts. But how to make xelatex use it? – user4035 Apr 23 '20 at 09:33

2 Answers2

3

Here is how to do it:

\documentclass{article}

\usepackage[russian, english]{babel}

\babelfont{rm}{Droid Serif}
\babelfont{sf}{Droid Sans}

\begin{document}

Some meaningful text.

Какой-то осмысленный текст.

\end{document}

See the babel manual for further details, because you may need to switch the language somehow with the Russian text.

enter image description here

Javier Bezos
  • 10,003
2

don't use \usepackage[T2A]{fontenc} with xelatex

This here should work

\documentclass{article}
\usepackage[default]{droidserif}
\usepackage[defaultsans]{droidsans}
\begin{document}
Какой-то осмысленный текст.
\sffamily 

Какой-то осмысленный текст.
\end{document}

enter image description here

Ulrike Fischer
  • 327,261