ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \startMPcode and \startMPpage
@ 2020-04-16 18:36 Jeong Dal
  2020-04-16 20:01 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Jeong Dal @ 2020-04-16 18:36 UTC (permalink / raw)
  To: list ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl
	ntg-context@ntg.nl


[-- Attachment #1.1: Type: text/plain, Size: 991 bytes --]

Hi,

The following sample code is working well in the \startMPpage ~ \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode.

The error message is 

\textfont0 is undefined (character 63)

l.6 \setstrut\strut $A$

If I remove “$” from the code, it is also working in \startMPcode ~ \stopMPcode.

Is there anything which I have to set for \startMPcode?

Best regards,

Dalyoung

%%%%%%%%
\startMPcode{doublefun}
%\startMPpage
numeric count, temp[], tt, minus, u; u := 1cm;
path p,q,r;
pair A,B,C,D;
string varName, ss, pos[];
p := unitsquare xyscaled (8u,3.5u);
draw p;

pos[0] := "bot";
pos[1] := "rt";
pos[2] := "top";
pos[3] := "lft";
varName := "yxwz";
count := 0;
pickup pencircle scaled 5pt;

for i = 0 upto 3: 
    drawdot (point i of p);
    draw lmt_text[
        text = "$" & char(65+i) & "$",
        anchor = pos[i],
        offset = 2pt,
        position = point i of p,  
    ];
endfor;
%\stopMPpage
\stopMPcode



[-- Attachment #1.2: Type: text/html, Size: 8584 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \startMPcode and \startMPpage
  2020-04-16 18:36 \startMPcode and \startMPpage Jeong Dal
@ 2020-04-16 20:01 ` Hans Hagen
  2020-04-16 22:56   ` Jeong Dal
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2020-04-16 20:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jeong Dal

On 4/16/2020 8:36 PM, Jeong Dal wrote:
> Hi,
> 
> The following sample code is working well in the \startMPpage ~ 
> \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode.
> 
> The error message is
> 
> \textfont0 is undefined (character 63)
> 
> l.6 \setstrut\strut $A$
> 
> If I remove “$” from the code, it is also working in \startMPcode ~ 
> \stopMPcode.
> 
> Is there anything which I have to set for \startMPcode?

\starttext ... \stoptext

or

\startMPpage[instance=doublefun]

\stopMPpage

> Best regards,
> 
> Dalyoung
> 
> %%%%%%%%
> \startMPcode{doublefun}
> %\startMPpage
> numeric count, temp[], tt, minus, u; u := 1cm;
> path p,q,r;
> pair A,B,C,D;
> string varName, ss, pos[];
> p := unitsquare xyscaled (8u,3.5u);
> *draw p;*
> *
> *
> pos[0] := "bot";
> pos[1] := "rt";
> pos[2] := "top";
> pos[3] := "lft";
> varName := "yxwz";
> count := 0;
> pickup pencircle scaled 5pt;
> 
> for i = 0 upto 3:
> drawdot (point i of p);
> draw lmt_text[
> text = "$" & char(65+i) & "$",
> anchor = pos[i],
> offset = 2pt,
> position = point i of p,
> ];
> endfor;
> %\stopMPpage
> \stopMPcode
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \startMPcode and \startMPpage
  2020-04-16 20:01 ` Hans Hagen
@ 2020-04-16 22:56   ` Jeong Dal
  0 siblings, 0 replies; 3+ messages in thread
From: Jeong Dal @ 2020-04-16 22:56 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2616 bytes --]

Dear Hans,

Thank you for the reply.
Since  \startMPcode … \stopMPcode form is used in the manual, I think that it is OK to use it for all cases.

Thank you again.

Best regards,

Dalyoung


> 2020. 4. 17. 오전 5:01, Hans Hagen <j.hagen@xs4all.nl> 작성:
> 
> On 4/16/2020 8:36 PM, Jeong Dal wrote:
>> Hi,
>> The following sample code is working well in the \startMPpage ~ \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode.
>> The error message is
>> \textfont0 is undefined (character 63)
>> l.6 \setstrut\strut $A$
>> If I remove “$” from the code, it is also working in \startMPcode ~ \stopMPcode.
>> Is there anything which I have to set for \startMPcode?
> 
> \starttext ... \stoptext
> 
> or
> 
> \startMPpage[instance=doublefun]
> 
> \stopMPpage
> 
>> Best regards,
>> Dalyoung
>> %%%%%%%%
>> \startMPcode{doublefun}
>> %\startMPpage
>> numeric count, temp[], tt, minus, u; u := 1cm;
>> path p,q,r;
>> pair A,B,C,D;
>> string varName, ss, pos[];
>> p := unitsquare xyscaled (8u,3.5u);
>> *draw p;*
>> *
>> *
>> pos[0] := "bot";
>> pos[1] := "rt";
>> pos[2] := "top";
>> pos[3] := "lft";
>> varName := "yxwz";
>> count := 0;
>> pickup pencircle scaled 5pt;
>> for i = 0 upto 3:
>> drawdot (point i of p);
>> draw lmt_text[
>> text = "$" & char(65+i) & "$",
>> anchor = pos[i],
>> offset = 2pt,
>> position = point i of p,
>> ];
>> endfor;
>> %\stopMPpage
>> \stopMPcode
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / http://context.aanhet.net <http://context.aanhet.net/>
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ <https://bitbucket.org/phg/context-mirror/commits/>
>> wiki     : http://contextgarden.net <http://contextgarden.net/>
>> ___________________________________________________________________________________
> 
> 
> -- 
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>       tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | www.pragma-pod.nl <http://www.pragma-pod.nl/>
> -----------------------------------------------------------------


[-- Attachment #1.2: Type: text/html, Size: 17164 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-16 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 18:36 \startMPcode and \startMPpage Jeong Dal
2020-04-16 20:01 ` Hans Hagen
2020-04-16 22:56   ` Jeong Dal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).