# Can I use Cambria font in TexStudio?

I am new in LaTex. However, I am using document class Beamer with mode as presentation. I tried to change the main font. But do not find anyway! Can I use Cambria font in TexStudio? please help.

-

If you have the ttf (TrueType) Cambria font, you can use XeLaTeX:

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{lipsum}

\setmainfont[Ligatures=TeX]{Cambria}
\usefonttheme{serif}
\usefonttheme{professionalfonts}

\begin{document}

\begin{frame}
\lipsum[4]
\end{frame}

\end{document}


Notice that since the default font theme in beamer switches to sans serif, one has to explicitly ask for a serif font using

\usefonttheme{serif}


or one of its variants (refer to the beamer manual).

-
Sorry, I am new in LaTex. Do I have to download and install XeLaTex? –  overwhelmed Apr 17 '14 at 1:00
@overwhelmed No; it should come with your LaTeX system (if its relatively updated). Your editor TeXstudio should have an option to choose which engine to use (there must be a menu showing things like pdflatex, lualatex, xelatex); choose xelatex to compile. All you need is to have the TrueType Cambria font; if your system doesn't already have it, there are numerous places in the web where you can download it. –  Gonzalo Medina Apr 17 '14 at 1:02
For the record, I believe your screenshot is incorrect: it looks like Latin Modern Sans (a sans-serif font) instead of Cambria (a serif font). –  hftf Apr 17 '14 at 1:28
@hftf You're right. Since the default font theme in beamer switches to sans serif, one has to explicitly ask for a serif font. I've updated my answer. Thanks for noticing it! –  Gonzalo Medina Apr 17 '14 at 1:34
@GonzaloMedina Got it. It is in Option>Configure TexStudio>Build>Default Compiler. Now changed to XeLaTex. However, now I see new problem: ** WARNING ** Couldn't open font map file "kanjix.map". By the way, I am using Windows 7, and I have Cambria font at C:\Windows\Fonts. But no change of font to Cambria in my current document after using your codes. What should I do now? –  overwhelmed Apr 17 '14 at 1:35