[NTG-context] Where is error in my code?

Mojca Miklavec mojca.miklavec.lists at gmail.com
Wed Jan 28 15:00:20 CET 2015


On Wed, Jan 28, 2015 at 5:49 AM, Van Dung Tang <nguyen969 at gmail.com> wrote:
> I edit 1 file metafun with follow:
>
> \startMPenvironment
> \usetypescript[times][texnansi]
> \switchtobodyfont[times,10pt]
> \stopMPenvironment
> \startMPpage
> fill fullcircle scaled 2cm withcolor red;
> label(\sometxt{Cn},origin) withcolor white;
> \stopMPpage
>
> After run context and recieve 1 picture with a space very very long at
> left my picture.
>
> Please help me find my error!

If you use MkII (texexec document.tex), use the following:

\setupcolors[state=start]
\usetypescript[times][texnansi]
\switchtobodyfont[times,10pt]

\starttext
\startMPpage
fill fullcircle scaled 2cm withcolor red;
label(\sometxt{\color[white]{Cn}},origin);
\stopMPpage
\stoptext

There is no need to set the font inside the MP environment when using
\sometxt{} (those definitions are causing issues with whitespaces) and
you need to set the colour inside the text.


If you use MkIV (context document.text), you should use:

\switchtobodyfont[times,10pt]

\starttext
\startMPpage
fill fullcircle scaled 2cm withcolor red;
label(\sometxt{\color[white]{Cn}},origin);
\stopMPpage
\stoptext

but

label(\sometxt{Cn},origin) withcolor white;

works in MKIV as well.

I strongly suggest you to use MkIV.

Mojca


More information about the ntg-context mailing list