[Tex/LaTex] Warning: Font shape undefined (Font) using xepersian package on windows

fontstexlivetexworkswindowsxepersian

I get the following warning and I figured the bold texts are not shown bold in the output:

Font shape `EU1/BNazanin(0)/m/it' undefined
(Font)              using `EU1/BNazanin(0)/m/n' instead 

I've seen this question which is quite similar to mine but I am on windows 10 (not Linux) plus my friends didn't have this problem (I have tex code of my friend's thesis and weirdly enough the output has bold texts while the same font was used…I can't get output from it but when I open it the output pdf is shown automatically), I'd like to know what is wrong with my document or probably with the fonts defined on my system. It'd be nice if there were a general solution to this warning.

\documentclass[a4paper,12pt]{report}
\usepackage{amsthm}
\usepackage[extrafootnotefeatures]{xepersian}
\settextfont[Scale=1.2]{B Nazanin}
\setlatintextfont{Calibri}
%\setlatintextfont[ExternalLocation,BoldFont={lmroman10-bold},BoldItalicFont={lmroman10-bolditalic},ItalicFont={lmroman10-italic}]{lmroman10-regular}
\defpersianfont\nastaliq[Scale=2]{IranNastaliq}
\defpersianfont\titr[Scale=1]{B Titr}
\defpersianfont\traffic[Scale=1]{B Traffic}
\deflatinfont\calibri{Calibri}
\renewcommand{\proofname}{\textbf{برهان}}

\begin{document}

\begin{proof}
سلام بر تو 
\end{proof}

سلام بر تو
\end{document}

Best Answer

The warning is not complaining about bold face, it's complaining about italic face, which indeed it should, because "B Nazanin" does not come in italic face.

The proof environment uses italic face for proofname, in addition to the bold face you've added, and that's what causes the warning you get.

Here is the output on my system: B Nazanin

As you can see the proofname is in bold face. Check the folder where your fonts are installed, then look for "B Nazanin". Each face (bold, italic, etc.) comes in a separate file, so in order to have the bold face for "B Nazanin", you should have another font file like "B Nazanin Bold.ttf". Hence, there should be (at least) 2 files, "B Nazanin.ttf" and "B Nazanin Bold.ttf" in your fonts directory.

As a general comment, "B Nazanin" is not even a standard font, and a lot of small things (such as the decimal mark, thousands separator, and the number zero) are either missing or aren't according to the standards. I highly recommend you to use a different font (such as the ones in the HM-X series).

Here is my result with "HM XNiloofar" font (and no warnings given): HM XNiloofar

If you really need to use "B Nazanin", I suggest you to use a font named "HM FNazli" from this series, which is almost identical to "B Nazanin", but it does not have the problems associated with "B Nazanin". Here is the same text typeset with this font (note that the shape of the letters are the same as the other font): HM FNazli

Related Question