I'm trying to compile this code:
\documentclass{book}
\usepackage{fontspec}
\setmainfont{CMU Serif}
\begin{document}
text
\end{document}
but receive this error
l.17 \setmainfont{CMU Serif}
?
in miktex-maketfm.log it says :
2017-10-08 23:57:03,239+0200 INFO miktex-maketfm - starting with command line: miktex-maketfm -v "CMU Serif"
2017-10-08 23:57:03,259+0200 INFO maketfm - Running miktex-makemf.exe...
2017-10-08 23:57:03,259+0200 INFO maketfm - running: miktex-makemf.exe --verbose "CMU Serif"
2017-10-08 23:57:03,449+0200 INFO maketfm - Running miktex-hbf2gf.exe...
2017-10-08 23:57:03,449+0200 INFO maketfm - running: miktex-hbf2gf.exe -g "CMU Serif" 300
2017-10-08 23:57:03,600+0200 FATAL miktex-maketfm - No creation rule for font "CMU Serif".
Previously I had problems compiling fontspec; it seemed that got solved by updating miktex, but the two may still be connected. Thank you.
Best Answer
You can use the call
\setmainfont{CMU Serif}
only if the font is installed as a system font (or with LuaLaTeX). How to do the installation is system dependent.Otherwise you can call the fonts “by font name”:
For the Typewriter Text font, also
tt
andit
can be used instead ofbtl
andbto
(if you don't plan to use boldface monospaced)