2009/5/12 Yue Wang:
here is the xelatex result given by a chinese user:
\documentclass{minimal} \usepackage{xeCJK} \setCJKfamilyfont{song}{SimSun} \begin{document} {hello {\CJKfamily{song}你好}}\par % 10000 lines \end{document}
got 209 pages, three seconds to run. note he is switching families 20000 times. (\family{foo} in latex == \switchbodyfont[foo] in context)
I didn't test that, but I suspect that one thing could make an enormous time difference if you switch the font 10.000 times. I suspect that what LaTeX does is something similar to the following (in ConTeXt slang): \starttypescript[cjk] [zhfont] \definefontsynonym [CJK] [file:SimSun] \definefontsynonym [CJKBold] [file:SimSun] % you could artificially embolden the font \definefontsynonym [CJKItalic] [file:SimSun] % you could artificially slant the font \definefontsynonym [CJKBoldItalic] [file:SimSun] \stoptypescript \definetypeface [myzhfont] [rm] [serif] [latin-modern] [default] \definetypeface [myzhfont] [ss] [sans] [latin-modern] [default] \definetypeface [myzhfont] [tt] [mono] [latin-modern] [default] \definetypeface [myzhfont] [cjk] [cjk] [zhfont] [default] \dorecurse{10000}{ hello {\cjk 你好 \it 你好}} In a similar way ConTeXt supports handwriting/calligraphy families (\hw, \cg I think; well, maybe you could even pretend that you are defining the "calligraphy font" to start with, as that one is already defined where it needs to be defined). If you manage to make the proposal above to run, this will save you the need for switching the whole typeface ten thousands of times and should become really fast (hopefully). Mojca