\thepage 无法兼容某些阿拉伯字体

\thepage 无法兼容某些阿拉伯字体

当我polyglossia在阿拉伯语LaTex文件中使用包时,\thepage命令不适用于某些字体,它会消失或不在正确的位置和形状,

\documentclass{article}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{polyglossia}
\usepackage[dvipsnames]{xcolor}
\usepackage{fancyhdr}
\usepackage{eso-pic}
\usepackage{tikz}
\usepackage{tikzpagenodes}
    %===================Set the font of the work=========
    %set fonts
    \setdefaultlanguage[locale=morocco]{arabic}
    \setotherlanguage{english}
    \newfontfamily\arabicfont[Script=Arabic, Scale=1]{amiri}
    \newfontfamily\englishfont{amiri}
    %=================Page layout======================
    \definecolor{col}{RGB}{1, 13, 54}  
    \definecolor{col1}{RGB}{255, 213, 79} 
    \definecolor{col2}{RGB}{129, 49, 247}
    \newcommand{\myfirststyle}{%
    \begin{tikzpicture}[remember picture, overlay]
        
        
        
        \node (A) at ([xshift=-200 ,yshift=16]current page.south){};
        \node (B) at ([xshift=200 ,yshift=16]current page.south){};
        \draw[gray] (A) -- (B);
        
        \node[anchor=center, fill=white, draw=gray, rounded corners=2pt] at ([yshift=16]current page.south) {\large\bfseries\sffamily\color{black}{\thepage}};
        
    \end{tikzpicture}
    }%
    \fancypagestyle{MyFirstStyle}{%
    \fancyhf{}
    \fancyhead[C]{\myfirststyle}
    \renewcommand{\headrulewidth}{0pt}
    }%
    \begin{document}
    \pagestyle{MyFirstStyle}
    السلام عليكم
    
    \end{document}

那么,谁能帮我解决这个问题?

相关内容