I'm trying to change the font of the template in https://pt.sharelatex.com/templates/cv-or-resume/moderncv-casual .
For that, I need to use XeLaTeX and, as I understand, set
\usepackage{fontspec}
\setmainfont{Baskerville}
\renewcommand*\namefont{\fontspec{Baskerville}\fontsize{40}{48}\selectfont}
\renewcommand*\titlefont{\fontspec{Baskerville}\fontsize{20}{24}\selectfont}
\renewcommand*\addressfont{\fontspec{Baskerville}\selectfont}
\renewcommand*\sectionfont{\fontspec{Baskerville}\fontsize{20}{24}\selectfont}
Unfortunately, when I try to compile with XeLaTeX I get
"kpathsea: Running mktexmf FontAwesome
[Some stuff here, and, finally]
Package fontspec Error: The font "FontAwesome" cannot be found. "
On the other side, when I run with LaTeX, everything goes fine.
By the way, I'm using a macOS High Sierra 10.13.6.
So, what's the problem. Do I have to install this font or something like this? If so, why LaTeX identify somehow this font? Furthermore, how can I install such font if that's the case?
An example as required in the comments
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage{fontspec}
\setmainfont{Baskerville}
\renewcommand*\namefont{\fontspec{Baskerville}\fontsize{40}{48}\selectfont}
\renewcommand*\titlefont{\fontspec{Baskerville}\fontsize{20}{24}\selectfont}
\renewcommand*\addressfont{\fontspec{Baskerville}\selectfont}
\renewcommand*\sectionfont{\fontspec{Baskerville}\fontsize{20}{24}\selectfont}
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\end{document}
For some reason, it also works for LuaLaTeX also as suggested by Herbert in the comments.
Thanks in advance.
template.texis installed in/usr/local/texlive/2018/texmf-dist/doc/latex/moderncv/examples/. Copy it into any user directory, insert your above additional setting and run it withxelatex. I have no problem here with macOS Mojave and TL2018 – Dec 01 '18 at 09:23lualatexinstead ofxelatex– Dec 01 '18 at 10:08~/Library/Fonts/or better set a link into~/Library/Fonts/which points to texlives font directory – Dec 01 '18 at 10:48