Native Unicode support of XeTeX is more wonderful for none english user. There are more and more people in Asia country like to use XeTex system. So I hope that asymptote can support xelatex engine.
of course latex can support chinese font with CJK. but the configuration process of CJK font is tedious.
I have done some initial jobs base Asymptote1.43. The attach file is my patch. with this patch, we can use asy -tex xelatex to compile asy source file which contain unicode font etc. chinese.
there is a known issue. after applying my patch. show the following code.
// the label "C" can use
assume the name of this file called test.asy, compile this code with asy -k -tex xelatex test.asy. will get test_0.eps which contain a full circle. and test_.tex, which can tex file include the test_0.eps and the label "C". because each file contian negative coordinate. then use xelatex -no-pdf to produce test_.xdv file. then use xdvipdfmx utility to produce test_.pdf file. we will get a cropped circle. because the xdvipdfmx can't handle negative coordinate correctly.
if use latex. in the final step of aysmptote. it will call dvips to transfer dvi file to ps file. and use -O parameter to adjust the corresponding negative coordinate. so i trid to use -x and -y parameter to do same job. but also get a cropped circle. according my debug. In the internally, xdvipdfmx will call gs utility to process test_0.eps file. but gs can't deal with negative coordinate. if pass -DEPSCrop parameter to gs(config in dvipdfmx.cfg file), we will get a full circle. but the position of label may not right. so i think it is a bug of xdvipdfmx. if asymptote not produce negative coordinate is more better.
my E-mail: Addylee2004@163.com