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?

-
\documentclass{...} is better than obsolete \documentstyle{..}? –  Harish Kumar Feb 8 '13 at 2:26
You are writing a LaTeX document, so you need to compile it using lualatex, not luatex. –  Aditya Feb 8 '13 at 2:34
I compiled using lualatex but i get following error message. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! fontspec error: "font-not-found" ! ! The font "Calibri" cannot be found. ! ! See the fontspec documentation for further information. ! ! For immediate help type H <return>. !.............................................. –  user15662 Feb 8 '13 at 3:01
I edited my question after making changes as suggested. –  user15662 Feb 8 '13 at 4:14
Just checking, but as the error message suggests, are you sure you have the Calibri font installed on your system? –  Xavier Feb 8 '13 at 7:18

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 mkluatexfontdb -v then you'll see which directories are searched.

-

I faced exactly the same problem, with TexLive install in ubuntu 14.04 LTS and I found a way to tackle it.

1. Uninstall texlive (if you downloaded it from software center) and install ubuntu-tl. https://github.com/scottkosty/install-tl-ubuntu (takes some time...)

2. Install windows fonts. Follow the instruction from here: http://www.pcworld.com/article/2863497/how-to-install-microsoft-fonts-in-linux-office-suites.html

The following preamble is now working perfectly:

\documentclass[11pt,a4paper]{article} \usepackage{fontspec} \defaultfontfeatures{Mapping=tex-text} \usepackage{xunicode} \usepackage{xltxtra} \setmainfont{Calibri} \usepackage{polyglossia} \setdefaultlanguage{greek} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{unicode-math} \setmathfont{Cambria Math}

Enjoy!

-