<div dir="ltr">I  am having problems trying to produce labels containing non-Latin text by the Asymptote program. (Not having gotten any help so far from the Asymptote help forum,) I'm trying my luck here, since the problem also involves xetex and polyglossia <br>

<br>For putting Arabic script text in labels, Asymptote works well with arabtex+latex calls. But because of some arabtex limitations, I am trying to use asymptote with the polyglossia+xelatex combination. Here is my problematic foo.asy code, run via <br>

<div style="text-align:center">asy -tex xelatex foo.asy <br></div><br>usepackge("color"); <br>usepackage("polyglossia"); <br>texpreamble("\setmainlanguage{english}\setotherlanguage{urdu}\newfontfamily\urdufont[Script=Arabic]{Times New Roman}"); <br>

//import unicode; //Not needed since polyglossia works with utf8 <br>pair A=(0,5); <br>dot(A); <br>label("${abcd}$",A,N); // Latin text displays OK <br>//label("$\texturdu{ابجد}$",A,S); // program fails when this line is uncommented <br>

<br>I'm getting all sort of error messages. The arabxeteX+xelatex combination produces similar errors. The trouble seems to be in Asymptote's handling of non-Latin text in xelatex. <br></div>