On Fri, May 9, 2008 at 2:53 PM, Jelle Huisman
Wolfgang Schuster wrote:
\Mywordstyle is a font switch: \def\Mywordstyle #1 {\switchtobodyfont[GentiumItalics]{#1} \switchtobodyfont[Gentium]}
Do you really want a font switch, isn't a style switch enough in your case from roman to italic and back.
Since I also need to be able to switch to a Non-Roman script I do need a font switch here (that's also the reason why I use XeTeX and MKII.) Anyway when I use \Mywordstyle inside the FormatSpan like this:
[\XMLpar{span}{class}{}] [word=>\let\FormatSpan\Mywordstyle, defenition=>\let\FormatSpan\Mywordstyle, xlanguagetag=>\let\FormatSpan\Mywordstyle]%
the font change is applied to the "word" and "xlanguagetag"-items, but not to the definition-item!?(see attachment) Any idea why and how to solve this? (And it looks like there is some unwanted extra space inserted between the "word" and "xlanguagetag" as well.)
You could also switch between different typescripts. If you really want to relly on \switchtobodyfont use it inside of a group because the font switch will be local to the group and you go back to the global font after the group. \usetypescript[palatino,times] \setupbodyfont[palatino] \defineXMLenvironment [span] [class=] {\bgroup \processaction [\XMLpar{span}{class}{}] [word=>\let\FormatSpan\italic, defenition=>\let\FormatSpan\bold, xlanguagetag=>\def\FormatSpan{\switchtotypeface[times]}]% \FormatSpan} {\egroup} \starttext \startXMLdata <span class="word" lang="nld">papa</span> <span class="defenition" lang="en"> <span class="xlanguagetag" lang="en">Eng</span> daddy </span> \stopXMLdata \stoptext Wolfgang