# xepersian, xetex can't find fonts

I'm trying to add persian text to my document but it doesn't accept the fonts I set and returns this error:

The font "XB Niloofar" cannot be found.


I just installed texlive using this guid. And this is the document I'm trying to compile:

\documentclass[12pt,a4paper,twoside]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{xepersian}
\settextfont[Scale=1, Mapping=arabic]{XB Niloofar}
\begin{document}
سلام!
\end{document}


Should I install these fonts or the problem is something else? Thank you

Yes. You should install the font in your OS, or use the font as an external file.

If you installed the font file (e.g. using Windows control panel/font), then you can call your font using

\settextfont{XB Niloofar}


no mapping is needed, since xepersian sets the proper mapping by default.

If you want to use your font, without installing it, your font file must be accessible by your engine, i.e. either in your working directory, or a in proper place in texmf. Use ExternalLocation parameter for this situation:

\settextfont[ExternalLocation]{xbniloofar.ttf}


or whatever the filename is.

Please, by the way, make sure that you always load xepersian as the last package.

• You may also find more info, and how to obtain XB Niloofar, in parsilatex.com – Hasan Zakeri Jun 16 '13 at 9:32

If you use a Linux distro such as Ubuntu then download the font from the open font library and copy it to ~/.fonts direcotry and run the following command to add it to the fonts cache:

\$ fc-cache -v ~/.fonts