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:


\settextfont[Scale=1, Mapping=arabic]{XB Niloofar}

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


3 Answers 3


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:


or whatever the filename is.

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


Just an answer for Linux users which will find this page via search engines:

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

Then recompile your document.


You must install the font for all users. In Windows 10 you can do it by right click on the ttf font and select "install for all users".

You must log in to answer this question.

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