[Tex/LaTex] LuaLaTeX + fontspec: Font not found

errorsluatex

This refers to my previous thread How to use the calibri font. I am using the Calibri font with lualatex. MWE:

  \documentclass[11pt,table,a4paper]{article}
  \usepackage{fontspec}
  \setmainfont{Calibri}
  \begin{document}
   The ends  of words and sentences are marked 
   by   spaces. It  doesn't matter how many 
   spaces    you type; one is as good as 100.  The
   end of   a line counts as a space.
  \end{document}

I am getting following error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!  
! fontspec error: "font-not-found"
! 
! The font "Calibri" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.3   \setmainfont{Calibri}

How can I avoid such error?

Best Answer

Calibri is a Windows font. If you have running Windows then it should be found by default, if present. Look into c:\Windows\Fonts

If you are running Linux then copy the TrueType files into your local /usr/local/share/fonts/truetype/ or your personal ~/.fonts/Calibri/. Then LuaTeX should update the font database by default.

You can also run luaotfload-tool -vvv --update --force then you'll see which directories were searched.