[Tex/LaTex] How to use the Calibri font

fonts

How can I use the Calibri font in LaTeX? I am using the following commands:

\usepackage{fontspec}
\setmainfont{Calibri}

I get the following error message:

!   Fatal fontspec error: "cannot-use-pdftex"
!   The fontspec package requires either XeTeX or LuaTeX to function.
!   You must change your typesetting engine to, e.g., "xelatex" or "lualatex"  
!   instead of plain "latex" or "pdflatex".
! 
!    See the fontspec documentation for further information.

Best Answer

As others have pointed out in comments, to use system fonts (or any local .otf or .ttf font) easily, you need to use the fontspec package and compile your document with either xelatex or lualatex. pdflatex won't work, but switching to xelatex or lualatex shouldn't require any major change in your document other than converting to utf8 encoding and removing any \usepackage[...]{inputenc}.

FYI, lualatex is the official successor of pdflatex in LaTeX3, and I personally see very little reasons not to switch asap to lualatex. If you want to read more on the differences, these links might provide you some more background:

Now, if you really can't / do not want to switch to xelatex or lualatex, and if you are really brave, you can stay with pdflatex, convert your Calibri font to Type1 and make it available to TeX. The tedious process is explained here.