15

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?

7
  • 5
    \documentclass{...} is better than obsolete \documentstyle{..}?
    – user11232
    Feb 8, 2013 at 2:26
  • 3
    You are writing a LaTeX document, so you need to compile it using lualatex, not luatex.
    – Aditya
    Feb 8, 2013 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>. !..............................................
    – manish
    Feb 8, 2013 at 3:01
  • I edited my question after making changes as suggested.
    – manish
    Feb 8, 2013 at 4:14
  • 2
    Just checking, but as the error message suggests, are you sure you have the Calibri font installed on your system?
    – Xavier
    Feb 8, 2013 at 7:18

3 Answers 3

12

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.

1
  • luaotfload-tool -vvv --update --force did the trick for me on Linux Opensuse Tumbleweed
    – rriemann
    Oct 20, 2020 at 22:08
3

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!

1

For those using overleaf, mainly two things have to be done:

  1. Select "XeLaTex" as your LaTeX enginge. This is described in point 1 of this help page. For me, selecting LuaLaTeX did not work.
  2. Upload the Calibri font files to your Project and write in \setmainfont{CALIBRI.TTF} in your TeX file. This is point 4 of the help page. As a Windows user, I found the font files in C:\Windows\Fonts (Linux user should find them, according to the answer of @Herbert in "your local /usr/local/share/fonts/truetype/ or your personal ~/.fonts/Calibri/")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .