When I'm compiling with XeLaTeX and I use \setmainfont{CMU Serif}
, the resulting characters are off by one. This means that an a becomes a b, a 1 becomes a 2, etc.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{CMU Serif}
\begin{document}
Test test2
12345
\end{document}
However, when I use \setmainfont{cmunrm.otf}
, using the filename, the output is correct:
When I use \setmainfont{CMU Sans Serif}
, the output is also correct, but if I use \setmainfont{CMU Serif Extra}
, for example, the output is wrong again, so it seems that there's something wrong with the Serif CMU fonts?
What causes this, and how can I solve it?
Edit: The console output after running xelatex -output-driver="xdvipdfmx -v" test.tex
is at http://pastebin.com/nb19aPuc.The log at http://pastebin.com/qgSC07YY. Interesting stuff seems to begin around line 349.
The output of fc-list | grep 'CMU Serif'
(http://pastebin.com/BNWzyRkH) seems to suggest that there's not something wrong with the installation of the font.
I'm running MikTex 2.9 on Windows 10 x64, with all packages updated to the latest version (at least, according to the MikTex update tool).
xelatex -output-driver="xdvipdfmx -v" file
(wherefile
is your file name, of course) and add the final part of the console output? Chances are that you'll be able to spot what goes wrong. What OS are you on? And what TeX distribution? – egreg Feb 27 '16 at 23:00