[Tex/LaTex] sharelatex and xepersian, Arabic digits instead of hindi (Persian)

sharelatexxepersian

I've uploaded my resume in my language (Persian) to my account in Sharelatex. I've also uploaded all required fonts to this project.

However, an annoying issue which I still couldn't resolve it is related to the numbers. All digits are in Hindi format when I compile using texlive in my laptop but once I compile it in sharelatex, they are changed to Arabic digits! to solve this issue, I installed a new virtual Persian keyboard and I could change them one by one, manually (very frustrating!).

However, I can't change 'page numbers' using this technique ! Page numbers are still in Arabic format ! would you please help me to know how can I change them to Hindi (Persian) digits.

Thank you

% !TeX document-id = {2945e35f-40c0-4ef0-9cad-f41eb4d0cccf}
% !TEX TS-program = XeLaTeX
% Commands for running this example:
%    xelatex Amintoosi_CV
% End of Commands
\PassOptionsToPackage{pdfpagelabels=false}{hyperref} 
\documentclass[11pt,a4paper]{bidimoderncv}
% M.Amintoosi
% برای اجرا باید دنباله کارهای زیر را انجام دهید:
% xelatex Amintoosi_CV
% bibtex Amintoosi_CV
% xelatex Amintoosi_CV
% xelatex Amintoosi_CV

%\usepackage[numbers]{natbib}
%\usepackage{bibentry}
%\nobibliography*
\usepackage[numbers]{natbib}%
\setlength{\bibhang}{2em}
\usepackage{ragged2e}
\usepackage{verbatim}
\cvtheme[blue]{bidiclassic}%casual} 
\usepackage{pifont}
\usepackage[scale=0.8]{geometry}
\usepackage{xepersian}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{fontspec}    %Added to use XB ZAR font in Sharelatex
%\settextfont[
%  Ligatures=TeX,
%  BoldFont=XB_ZARBD.TTF,
%  ItalicFont=XB_ZARIT.TTF,
%  BoldItalicFont=XB_ZARBDIT.TTF]{XB_ZAR.TTF}
%%%%%%%   OR   %%%%%%%%
%\usepackage{fontspec}    %Added to use XB ZAR font in Sharelatex
%\settextfont[
% Ligatures=TeX,
%  BoldFont=B_Nazanin_Bold.TTF,
%ItalicFont=B_.TTF,
%  BoldItalicFont=B_Nazanin_Black.TTF]{B_Nazanin_Regular.TTF}
%%%%%%%   OR   %%%%%%%%
\usepackage{fontspec}    %Added to use XB ZAR font in Sharelatex
\settextfont[
Ligatures=TeX,
BoldFont=XB_NiloofarBd.TTF,
ItalicFont=XB_NiloofarIt.TTF,
BoldItalicFont=XB_NiloofarBdIt.TTF]{XB_Niloofar.TTF}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\settextfont[Scale=1]{XB_ZAR.TTF}%{XB Niloofar}%{B Nazanin}%

%\setlatintextfont[Scale=1]{TIMES.TTF}%{Linux Libertine}%
\defpersianfont\nastaliq[Scale=1.2]{IRANNASTALIQ.TTF}
\setdigitfont{nazli.ttf}
\AtBeginDocument{\recomputelengths} 
\firstname{}
\familyname{}
\resumename{رزومه}
\title{شرح حال}               
\address{}   
\mobile{۰۹۱۲380024445}
%\phone{}  
%\fax{شماره فکس}                          
\email{lopdp[11236@jdll.com]}
\extrainfo{}} 
\photo[64pt]{100320.jpg}                         
%\quote{نقل قول}  
\begin{document}
\maketitle

\subsection{سیستم های عامل}
%\cvline{سیستم های عامل}{:}
%\cvline{سیستم های عامل:}{آشنايي کامل با ويندوز ، مکينتاش و توزيع هاي مختلف لينوکس (اعم از ردهت ، فدورا، سوزه، ابونتو وغيره)}
\begin{latin}
    \cvlistdoubleitem[\Neutral]{Windows}{Mac OS}
    \cvlistdoubleitem[\Neutral]{Linux (Redhat, Fedora, Suse, Ubuntu, etc)}{}
\end{latin}
\subsection{نرم افزارهای تخصصی}
%\cvline{برنامه های تخصصی}{:}
\begin{latin}
    \cvlistdoubleitem[\Neutral]{ANSYS HFSS}{CST Microwave Studio Suite }
    \cvlistdoubleitem[\Neutral]{Advanced Digital Systems (ADS)}{MATLAB }
    \cvlistdoubleitem[\Neutral]{AutoCAD}{AutoCAD }
    \cvlistdoubleitem[\Neutral]{SketchUp}{Solid Works }
    \cvlistdoubleitem[\Neutral]{Verilog HDL}{AWR-EDA }
    \begin{comment}
    \begin{itemize}
    \item[$\bullet$] ~~\lr{High Frequency Structure Simulator (HFSS)}
    \item[$\bullet$] ~~\lr{CST Microwave Studio Suite}
    \item[$\bullet$] ~~\lr{Advanced Digital Systems (ADS)}
    \item[$\bullet$] ~~\lr{MATLAB, AutoCAD, SketchUp, Solid Works}
    \end{itemize}
    \end{comment}
\end{latin}

\subsection{نرم افزارهای کاربردی}
%\cvline{برنامه های کاربردی}{:}
\begin{comment}
\begin{latin}
\begin{itemize}
\item[$\bullet$] ~~Microsoft Office (Word, Excel, Access, OneNote, Visio,         OutLook, PowerPoint)
\item[$\bullet$] ~~Adobe (Photoshop, Illustrator, InDesign, Muse, After    Effect, Premier)
\item[$\bullet$] ~~\LaTeX, WinEdt, TeXMaker, Texstudio, Notepad++,Gedit, \TeX live, Latexila
\item[$\bullet$] ~~\XePersian, Farsi\TeX, Bib\TeX, MiK\TeX, Corel Draw and etc
\end{itemize}
\end{latin}
\end{comment}

\begin{latin}
    \cvlistdoubleitem[\Neutral]{Microsoft Office Products}{Adobe Products}
    \cvlistdoubleitem[\Neutral]{\LaTeX}{Web Design}
    \cvlistdoubleitem[\Neutral]{CorelDraw}{}
\end{latin}




\section{تألیفات}

\subsection{لیست مقالاتی که تاکنون به چاپ رسیده اند}
\def\refname{این لیست تنها شامل مقالاتی است که به \textbf{چاپ نهایی} رسیده اند و مقالاتی که در مرحله داوری هستند را\textbf{ شامل نمی شود}}
\nocite{*}
\bibliographystyle{plainyr}%{asa-fa}%
\setLTRbibitems
%\nobibliography{citations}
\bibliography{citations}
%\bibentry{majid2010utm}
\end{document}

Update:
I found where the problem is happening but I'm still looking for a solution! The issue relates to following part:

\settextfont[
Ligatures=TeX,
BoldFont=XB_NiloofarBd.TTF,
ItalicFont=XB_NiloofarIt.TTF,
BoldItalicFont=XB_NiloofarBdIt.TTF]{XB_Niloofar.TTF}

If I comment the above lines in my main code (in my laptop), it automatically uses the XB_Niloofar fonts which is installed in my laptop. But when I upload to Sharelatex or Overleaf, I need to upload them to root folder, too. Whatever the issue is, it is related to above 5 lines. How can I define the digit fonts in above lines ?
(I already used setdigitfonts but it didn't work)

Best Answer

This is because of your Ligatures=TeX. Here is a minimal example showing the problem

\documentclass{article}
\usepackage{xepersian}
\settextfont[Ligatures=TeX]{Yas}
\begin{document}
\today
\end{document}

\settextfont uses parsidigits mapping and when you have Ligatures=TeX, you overwrite it with tex-text mapping. parsidigits does all necessary ligatures so Ligatures=TeX is not needed.

Related Question