On Thu, Jun 9, 2011 at 23:20, Philipp Gesang wrote:
Hi all,
I’m struggling with the font used in metapost. The only way to actually change it appears to be enclosing the mp graphic in two statements of \setupbodyfont[…] -- which I need to avoid. In the following example, the background text should be typeset (drawn) as lm sans, whereas the main font should be left untouched (serif).
An alternative to Wolfgang's answer when you want to use complex font definitions (or other complex commands) is to use \sometxt. \usetypescript[iwona] \definetextext[myfont]{\switchtobodyfont[iwona,ss,30pt]\bi} \starttext \startuseMPgraphic{bg} draw \sometxt[myfont]{I wanna get rid of those serifs!} withcolor blue ; \stopuseMPgraphic \useMPgraphic{bg} \stoptext Mojca