From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE,URIBL_BLACK autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 4661 invoked from network); 4 Dec 2023 16:36:32 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 4 Dec 2023 16:36:32 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A32A24827E1 for ; Mon, 4 Dec 2023 17:36:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3R3XLtKjOlm6 for ; Mon, 4 Dec 2023 17:36:26 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id D3595482059 for ; Mon, 4 Dec 2023 17:35:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3EC3648156B for ; Mon, 4 Dec 2023 17:35:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mz6T371BdR2k for ; Mon, 4 Dec 2023 17:35:26 +0100 (CET) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 5B575480E75 for ; Mon, 4 Dec 2023 17:35:26 +0100 (CET) Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-67ac8e5566cso7071736d6.3 for ; Mon, 04 Dec 2023 08:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701707725; x=1702312525; darn=ntg.nl; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=7ezZ4GSCALMu3Bmx6AL48ixGF8ATmB8qrKYuArC54jY=; b=G8ssljG4SqjcFIix06sS3l+rmnPMbA09ddt5Cgjh3n+ggLwPl1JOz7TkZGnlxTCmnk 5IJhYJ8X94aZuz/FBY19GIaQo/XlY0+9Bjfi8HIaXA+ikBPeox63l7X/ZSWgPbwNXKAj gEMCVCJZRnN6QeWU1uVmI6rdRuUADEBWSulq0O0+0sHpXz48BEb4QircnXCf8XcRYLsP T+V0Q3jAuBuOUsGrl1tN5zPcNSozizfFO/5cMIDWMIyz0AHf0Fmx283HaVj45EzFjVy1 3PwXFOI51ZdLI2AQhC6aNQT91iOKQEb4lxtWJSE4tAIMRKXIeVheXDYd0L+FoEOXya3B MSig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701707725; x=1702312525; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7ezZ4GSCALMu3Bmx6AL48ixGF8ATmB8qrKYuArC54jY=; b=QXUJLvaB5O23tIcQRhE+5iq+aE9XNMnpG1XAXFmpWT3uSLn0tZ5SWFL6L6jhgk3Akc gNyAt8PijMeJy6DJcQ7SW1yGbhPh1hNSf7tfPJKdGLJJhtk3/BreYAPwjaaoKJPDOEZo d9JCm/SETONu7q66QMGV1J42f5PRouqtAOmidHIOsjoz68XJMlRaRO8cvkgYbp57Ekps DAEh0hHfLwaV106grVu8EuFA2wvuO6rSqxF2pjD1D9jvMnQ9X9x84cpMcJQ0fjyLhvqI DV+2gNwdOEmSz8dM9DD4uW1vDgSG4FFJHRwW8JZvBkjfl9i+ypcIg/ynxYW4L0gfpplY mycg== X-Gm-Message-State: AOJu0YxV4NDL4yqa1qxqKjci+ws3/ntwxVb1U13B3+0ovHsbB2blRF4z rv7MeHFshnFPsSSdAudsQe59fCjyeFQ= X-Google-Smtp-Source: AGHT+IHj/h2mu4+HUH+IOM5VZ+TacZYaOOCogZLLwM8RqJmENJTlyEGqYQAJQTpDGROM2ekoJAqXWw== X-Received: by 2002:a0c:cd85:0:b0:67a:a721:b19a with SMTP id v5-20020a0ccd85000000b0067aa721b19amr5938713qvm.85.1701707724446; Mon, 04 Dec 2023 08:35:24 -0800 (PST) Received: from smtpclient.apple ([142.169.16.139]) by smtp.gmail.com with ESMTPSA id p4-20020a0ce184000000b0067abde1b2c2sm1523318qvl.100.2023.12.04.08.35.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Dec 2023 08:35:24 -0800 (PST) From: Fabrice L Message-Id: <68B7A1DD-7FF3-4405-B4D4-9037436A0638@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Date: Mon, 4 Dec 2023 11:35:04 -0500 In-Reply-To: To: mailing list for ConTeXt users References: X-Mailer: Apple Mail (2.3774.200.91.1.1) Message-ID-Hash: V3HNMX3SMVUE2C5MN3E6CKEPZNZG3FYF X-Message-ID-Hash: V3HNMX3SMVUE2C5MN3E6CKEPZNZG3FYF X-MailFrom: fabrice.alpha@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: multipage metapost output from ConTeXt List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============2359118680355166581==" --===============2359118680355166581== Content-Type: multipart/alternative; boundary="Apple-Mail=_4DB48218-4D82-4760-BE5F-74E69E9E9830" --Apple-Mail=_4DB48218-4D82-4760-BE5F-74E69E9E9830 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Emanuel, > Le 2 d=C3=A9c. 2023 =C3=A0 12:08, Emanuel Han via ntg-context = a =C3=A9crit : >=20 > Hi Mikael, >=20 > here's a very simple mwe for the label(textext()) issue. On page 1, = the text "Word 1" should be drawn in position z1. On page 2, the same = text in the same position should be visible, and the text "Mot 2" in = position p2 should be added. And so on. >=20 > \startMPinclusions >=20 > picture p[]; > path TheFrame ; > TheFrame :=3D fullsquare scaled 5in ; > =20 > z1 =3D (60,40); > z2 =3D (40,90);=20 > z3 =3D (10,70); >=20 > p1:=3Dimage( > label(textext("Word 1"), z1); > ); >=20 > p2:=3Dimage( > label(textext("Mot 2"), z2); > ); >=20 > p3:=3Dimage( > label(textext("Parola 3"), z3); > ); >=20 > \stopMPinclusions >=20 > \starttext >=20 > \dorecurse{3}{ % Frame > \startMPpage[pagestate=3Dstart] =20 > currentime :=3D #1 ; > % Just for learning : > draw TheFrame withpen pencircle scaled .1in withcolor magenta ; > draw textext("T=3D"&decimal(currentime)) scaled 2 shifted(0,2in) = withcolor magenta ; > for k=3D1 upto currentime: draw p[k]; endfor > setbounds currentpicture to TheFrame ; >=20 > desiredformat :=3D 1080;% In pixels (will be converted by default at = 72dpi) > currentpicture :=3D currentpicture xysized (desiredformat = ,desiredformat ); > =20 > \stopMPpage > } >=20 > \stoptext >=20 > On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist wrote: > Hi Emanuel, >=20 > I am not sure I understand your question, and since you use fonts that > i do not have, I cannot test your example as is. But, maybe, if you > want to redraw a picture, you can do >=20 > addto currentpicture also p1; >=20 > where you want it. >=20 > /Mikael >=20 > PS For the text thing, I did not get it. Could one have a _very > simple_ example showing only that problem and no other problem? >=20 > On Sat, Dec 2, 2023 at 12:58=E2=80=AFPM fv leung = wrote: > > > > You didn't specify the color of path A in p2 and p4. So it's drawn = in black. > > The other issue, I can't help. > > > > Emanuel Han via ntg-context =E6=96=BC = 2023=E5=B9=B412=E6=9C=882=E6=97=A5 =E9=80=B1=E5=85=AD = =E4=B8=8B=E5=8D=887:23=E5=AF=AB=E9=81=93=EF=BC=9A > >> > >> So is there a way to circumvent these issues? Or an explanation for = this behavior, so that I can try to find a solution by myself? > >> > >> Thanks > >> Emanuel > >> > >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context = wrote: > >> > >> Dear Aditya and Fabrice, > >> thanks for your responses. > >> > >> I included some of Fabrice's code into mine for testing purpose, = and indeed the multipage works now. > >> What is bizarre is that issues appear now that didn't appear = before: > >> > >> Path A is drawn with color red on page 1, and in color black on all = following pages, while it should stay red. > >> textext(, ) is overwriting with = "T=3D"&decimal(currentime) which has been used previously in textext() = before the for k=3D1 endfor loop. This overwriting happens only for the = first textext() which occurs inside the for k=3D1 endfor loop. All other = textext() inside the for k=3D1 endfor loop are not drawn at all. If the = line =C2=AB draw textext("T=3D"&decimal(currentime)) scaled 2 = shifted(0,2in) withcolor magenta ; =C2=BB is commented out, the first = textext() inside the for k=3D1 endfor loop is not drawn neither. It must = be an issue with textext(), because when I replace textext() by = lmt_outline[], the text is drawn. > >> > >> Adjusted mwe: > >> > >> \enableregime[utf] % enable unicoded input > >> > >> \definefontfamily [RomanFont] [rm] [calluna] > >> > >> \definefontfamily [KoreanFont] [rm] [applemyungjo] > >> > >> \definefontfamily [JapaneseFont] [rm] [hannotatesc] > >> > >> \definefontfeature > >> [fea] > >> [mode=3Dnode,language=3Ddflt,script=3Darab, > >> init=3Dyes, > >> medi=3Dyes, > >> fina=3Dyes, > >> isol=3Dyes, > >> calt=3Dyes, > >> rlig=3Dyes, > >> tlig=3Dyes, > >> trep=3Dyes, > >> curs=3Dyes, > >> kern=3Dyes, > >> mark=3Dyes > >> ] > >> > >> \starttypescript [serif] [notonaskharabic] > >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] = [features=3Dfea] > >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] = [features=3Dfea] > >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] = [features=3Dfea] > >> \definefontsynonym [notonaskharabic-Bold-Italic] = [name:notonaskharabic] [features=3Dfea] > >> \stoptypescript > >> > >> \starttypescript [serif] [notonaskharabic] > >> \usetypescript[serif][fallback] > >> \definefontsynonym [Serif] [notonaskharabic-Light] [features=3Dfea] > >> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] = [features=3Dfea] > >> \definefontsynonym [SerifBold] [notonaskharabic-Bold] = [features=3Dfea] > >> \definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] = [features=3Dfea] > >> \stoptypescript > >> > >> \starttypescript [notonaskharabic] > >> \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] = [default] > >> \stoptypescript > >> > >> \usetypescript[notonaskharabic] > >> > >> \setupbodyfont [RomanFont] > >> > >> \usecolors[crayola] > >> > >> \startMPinclusions > >> > >> picture p[]; > >> path TheFrame ; > >> TheFrame :=3D fullsquare scaled 5in ; > >> > >> z0 =3D (0,0); > >> z1 =3D (60,40); > >> z2 =3D (40,90); > >> z3 =3D (10,70); > >> z4 =3D (30,50); > >> z5 =3D (90,70); > >> z6 =3D (-10,70); > >> > >> path A; A =3D z0..z1..z2..z3..z4 ; > >> pair AStartPoint; AStartPoint =3D point 0 of A; > >> pair AEndPoint; AEndPoint =3D point 4 of A; > >> path B; B =3D z5..z6; > >> pair BStartPoint; BStartPoint =3D point 0 of B; > >> pair BEndPoint; BEndPoint =3D point 1 of B; > >> path C; C =3D AStartPoint..AEndPoint; > >> > >> p1:=3Dimage( > >> draw A withcolor red; > >> ); > >> > >> p2:=3Dimage(draw A; label(lmt_outline [ > >> text =3D "\JapaneseFont =E6=97=A5=E6=9C=AC=E8=AA=9E" > >> ], AEndPoint);); > >> > >> p3:=3Dimage( > >> label(textext("\notonaskharabic \textdir TRT =D8=AF=D8=A7=D9=86=DA=AF= ") scaled 1.2, BStartPoint); > >> ); > >> > >> p4:=3Dimage(draw A; label(lmt_outline [ > >> text =3D "\KoreanFont =ED=95=9C=EA=B5=AD=EC=96=B4" > >> ], AStartPoint);); > >> > >> p5:=3Dimage( > >> label(textext("b=C4=81ng"), BEndPoint); > >> draw C withcolor green; > >> ); > >> > >> p6:=3Dimage( > >> draw B withcolor blue; > >> ); > >> \stopMPinclusions > >> > >> \starttext > >> > >> \dorecurse{6}{ % Frame > >> \setupMPpage[background=3Dcolor, backgroundcolor=3DSpringGreen] > >> \startMPpage[pagestate=3Dstart] > >> currentime :=3D #1 ; > >> % Just for learning : > >> draw TheFrame withpen pencircle scaled .1in withcolor magenta ; > >> draw textext("T=3D"&decimal(currentime)) scaled 2 shifted(0,2in) = withcolor magenta ; > >> for k=3D1 upto currentime: draw p[k]; endfor > >> setbounds currentpicture to TheFrame ; > >> > >> desiredformat :=3D 1080;% In pixels (will be converted by default = at 72dpi) > >> currentpicture :=3D currentpicture xysized (desiredformat = ,desiredformat ); > >> > >> \stopMPpage > >> } > >> > >> \stoptext > >> On Nov. 27 2023, at 11:25 pm, Aditya Mahajan = wrote: > >> > >> On Mon, 27 Nov 2023, Fabrice L wrote: > >> > >> > Hi, > >> > > >> > It is fun fact very easy to do. You just use \startMPpage (=E2=80=A6= ) \stopMPpage multiple times. Here is an example which build an = animation of a particle moving according to a Brownian motion. > >> > >> A very similar option is to pass a variable to a metapost drawing. = This is what I use: > >> > >> https://adityam.github.io/context-blog/post/metapost-animation/ > >> > >> It only works when viewed in acrobat, you can just comment out the = animation part and wrap it in \startTEXpage .. \stopTEXpage to get = multi-page animation. > >> > >> = Aditya____________________________________________________________________= _______________ > >> If your question is of interest to others as well, please add an = entry to the Wiki! > >> > _____________________________________________ I do not understand why your original code does not work, and I know = Mickael has offered you a solution, but there is, just for curiosity, = another one to achieve your goal using \MPinclusions : % 8 < =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \starttext \startMPinclusions path TheFrame ; TheFrame :=3D fullsquare scaled 5in ; pair Coord[] ; string TheText[] ;=20 TheText[1] :=3D "Word 1" ; Coord[1] :=3D (60,40) ; TheText[2] :=3D "Word 2" ; Coord[2] :=3D (40,90) ; TheText[3] :=3D "Word 3" ; Coord[3] :=3D (10,70) ; \stopMPinclusions \dorecurse{3}{ % Frame \startMPpage%[pagestate=3Dstart] =20 currentime :=3D #1 ; % Just for learning : draw TheFrame withpen pencircle scaled .1in withcolor magenta ; draw textext("T=3D"&decimal(currentime)) scaled 2 shifted(0,2in) = withcolor magenta ; for k=3D1 upto currentime:=20 draw textext(TheText[k]) shifted Coord[k] ; endfor ; =20 \stopMPpage } \stoptext % 8 < =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Fabrice.=20 --Apple-Mail=_4DB48218-4D82-4760-BE5F-74E69E9E9830 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = Emanuel,

Le 2 d=C3=A9c. 2023 =C3=A0 12:08, Emanuel Han via = ntg-context <ntg-context@ntg.nl> a =C3=A9crit :

Hi Mikael, =

here's a very simple mwe for the label(textext()) issue. = On page 1, the text "Word 1" should be drawn in position z1. On page 2, = the same text in the same position should be visible, and the text "Mot = 2" in position p2 should be added. And so on. =

\startMPinclusions

picture = p[];
 path TheFrame ;
 TheFrame :=3D = fullsquare scaled 5in ;
 
 z1 =3D = (60,40);
 z2 =3D (40,90); 
 z3 =3D = (10,70);

p1:=3Dimage(
    = label(textext("Word 1"), = z1);
);

p2:=3Dimage(
    = label(textext("Mot 2"), = z2);
);

p3:=3Dimage(
    = label(textext("Parola 3"), = z3);
);

\stopMPinclusions

\starttext=

\dorecurse{3}{ % = Frame
\startMPpage[pagestate=3Dstart]   =
 currentime :=3D #1 ;
 % Just for = learning :
 draw TheFrame withpen pencircle scaled .1in = withcolor magenta ;
 draw = textext("T=3D"&decimal(currentime)) scaled 2 shifted(0,2in) = withcolor magenta ;
 for k=3D1 upto currentime: draw = p[k]; endfor
 setbounds currentpicture to TheFrame = ;

 desiredformat :=3D 1080;% In pixels (will be = converted by default at 72dpi)
 currentpicture :=3D = currentpicture xysized (desiredformat ,desiredformat );
  =
\stopMPpage
} =

\stoptext

On Dez. 2 2023, at 5:22 pm, Mikael = Sundqvist <mickep@gmail.com> wrote:
Hi = Emanuel,

I am not sure I understand your question, and = since you use fonts that
i do not have, I cannot test your = example as is. But, maybe, if you
want to redraw a picture, = you can do

addto currentpicture also = p1;

where you want = it.

/Mikael

PS For the text thing, I did not = get it. Could one have a _very
simple_ example showing only = that problem and no other problem?

On Sat, Dec 2, 2023 at = 12:58=E2=80=AFPM fv leung <fvleung@gmail.com> = wrote:
>
> You didn't specify the color of = path A in p2 and p4. So it's drawn in black.
> The other = issue, I can't help.
>
> Emanuel Han via = ntg-context <ntg-context@ntg.nl> =E6=96=BC 2023=E5=B9=B412=E6=9C=882= =E6=97=A5 =E9=80=B1=E5=85=AD = =E4=B8=8B=E5=8D=887:23=E5=AF=AB=E9=81=93=EF=BC=9A
>>
=
>> So is there a way to circumvent these issues? Or an = explanation for this behavior, so that I can try to find a solution by = myself?
>>
>> Thanks
>> = Emanuel
>>
>> On Nov. 29 2023, at 12:25 = pm, Emanuel Han via ntg-context <ntg-context@ntg.nl> = wrote:
>>
>> Dear Aditya and = Fabrice,
>> thanks for your = responses.
>>
>> I included some of = Fabrice's code into mine for testing purpose, and indeed the multipage = works now.
>> What is bizarre is that issues appear now = that didn't appear before:
>>
>> Path A = is drawn with color red on page 1, and in color black on all following = pages, while it should stay red.
>> = textext(<text>, <pair>) is overwriting <text> with = "T=3D"&decimal(currentime) which has been used previously in = textext() before the for k=3D1 endfor loop. This overwriting happens = only for the first textext() which occurs inside the for k=3D1 endfor = loop. All other textext() inside the for k=3D1 endfor loop are not drawn = at all. If the line =C2=AB draw textext("T=3D"&decimal(currentime)) = scaled 2 shifted(0,2in) withcolor magenta ; =C2=BB is commented out, the = first textext() inside the for k=3D1 endfor loop is not drawn neither. = It must be an issue with textext(), because when I replace textext() by = lmt_outline[], the text is drawn.
>>
>> = Adjusted mwe:
>>
>> \enableregime[utf] % = enable unicoded input
>>
>> = \definefontfamily [RomanFont] [rm] = [calluna]
>>
>> \definefontfamily = [KoreanFont] [rm] [applemyungjo]
>>
>> = \definefontfamily [JapaneseFont] [rm] = [hannotatesc]
>>
>> = \definefontfeature
>> [fea]
>> = [mode=3Dnode,language=3Ddflt,script=3Darab,
>> = init=3Dyes,
>> medi=3Dyes,
>> = fina=3Dyes,
>> isol=3Dyes,
>> = calt=3Dyes,
>> rlig=3Dyes,
>> = tlig=3Dyes,
>> trep=3Dyes,
>> = curs=3Dyes,
>> kern=3Dyes,
>> = mark=3Dyes
>> ]
>>
>> = \starttypescript [serif] [notonaskharabic]
>> = \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] = [features=3Dfea]
>> \definefontsynonym = [notonaskharabic-Bold] [name:notonaskharabic] = [features=3Dfea]
>> \definefontsynonym = [notonaskharabic-Italic] [name:notonaskharabic] = [features=3Dfea]
>> \definefontsynonym = [notonaskharabic-Bold-Italic] [name:notonaskharabic] = [features=3Dfea]
>> = \stoptypescript
>>
>> \starttypescript = [serif] [notonaskharabic]
>> = \usetypescript[serif][fallback]
>> \definefontsynonym = [Serif] [notonaskharabic-Light] [features=3Dfea]
>> = \definefontsynonym [SerifItalic] [notonaskharabic-Italic] = [features=3Dfea]
>> \definefontsynonym [SerifBold] = [notonaskharabic-Bold] [features=3Dfea]
>> = \definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] = [features=3Dfea]
>> = \stoptypescript
>>
>> \starttypescript = [notonaskharabic]
>> \definetypeface [notonaskharabic] = [rm] [serif] [notonaskharabic] [default]
>> = \stoptypescript
>>
>> = \usetypescript[notonaskharabic]
>>
>> = \setupbodyfont [RomanFont]
>>
>> = \usecolors[crayola]
>>
>> = \startMPinclusions
>>
>> picture = p[];
>> path TheFrame ;
>> TheFrame :=3D = fullsquare scaled 5in ;
>>
>> z0 =3D = (0,0);
>> z1 =3D (60,40);
>> z2 =3D = (40,90);
>> z3 =3D (10,70);
>> z4 =3D = (30,50);
>> z5 =3D (90,70);
>> z6 =3D = (-10,70);
>>
>> path A; A =3D = z0..z1..z2..z3..z4 ;
>> pair AStartPoint; AStartPoint =3D = point 0 of A;
>> pair AEndPoint; AEndPoint =3D point 4 = of A;
>> path B; B =3D z5..z6;
>> pair = BStartPoint; BStartPoint =3D point 0 of B;
>> pair = BEndPoint; BEndPoint =3D point 1 of B;
>> path C; C =3D = AStartPoint..AEndPoint;
>>
>> = p1:=3Dimage(
>> draw A withcolor red;
>> = );
>>
>> p2:=3Dimage(draw A; = label(lmt_outline [
>> text =3D "\JapaneseFont = =E6=97=A5=E6=9C=AC=E8=AA=9E"
>> ], = AEndPoint););
>>
>> = p3:=3Dimage(
>> label(textext("\notonaskharabic \textdir = TRT =D8=AF=D8=A7=D9=86=DA=AF") scaled 1.2, = BStartPoint);
>> = );
>>
>> p4:=3Dimage(draw A; = label(lmt_outline [
>> text =3D "\KoreanFont = =ED=95=9C=EA=B5=AD=EC=96=B4"
>> ], = AStartPoint););
>>
>> = p5:=3Dimage(
>> label(textext("b=C4=81ng"), = BEndPoint);
>> draw C withcolor = green;
>> );
>>
>> = p6:=3Dimage(
>> draw B withcolor = blue;
>> );
>> = \stopMPinclusions
>>
>> = \starttext
>>
>> \dorecurse{6}{ % = Frame
>> \setupMPpage[background=3Dcolor, = backgroundcolor=3DSpringGreen]
>> = \startMPpage[pagestate=3Dstart]
>> currentime :=3D #1 = ;
>> % Just for learning :
>> draw = TheFrame withpen pencircle scaled .1in withcolor magenta = ;
>> draw textext("T=3D"&decimal(currentime)) scaled = 2 shifted(0,2in) withcolor magenta ;
>> for k=3D1 upto = currentime: draw p[k]; endfor
>> setbounds = currentpicture to TheFrame ;
>>
>> = desiredformat :=3D 1080;% In pixels (will be converted by default at = 72dpi)
>> currentpicture :=3D currentpicture xysized = (desiredformat ,desiredformat );
>>
>> = \stopMPpage
>> }
>>
>> = \stoptext
>> On Nov. 27 2023, at 11:25 pm, Aditya = Mahajan <adityam@umich.edu> = wrote:
>>
>> On Mon, 27 Nov 2023, = Fabrice L wrote:
>>
>> > = Hi,
>> >
>> > It is fun fact very = easy to do. You just use \startMPpage (=E2=80=A6) \stopMPpage multiple = times. Here is an example which build an animation of a particle moving = according to a Brownian motion.
>>
>> A = very similar option is to pass a variable to a metapost drawing. This is = what I use:
>>
>> = https://adityam.github.io/context-blog/post/metapost-animation/
= >>
>> It only works when viewed in acrobat, you = can just comment out the animation part and wrap it in \startTEXpage .. = \stopTEXpage to get multi-page = animation.
>>
>> = Aditya____________________________________________________________________= _______________
>> If your question is of interest to = others as well, please add an entry to the = Wiki!
>>
_______________________________________= ______

I do = not understand why your original code does not work, and I know Mickael = has offered you a solution, but there is, just for curiosity, =  another one to achieve your goal using \MPinclusions =  :

% 8 < = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\starttext

\startMPinclusions

 path TheFrame ;
 TheFrame :=3D= fullsquare scaled 5in ;

 pair Coord[] = ;
 string TheText[] = ; 

 TheText[1] :=3D "Word 1" ; = Coord[1] :=3D (60,40) ;
 TheText[2] :=3D "Word 2" ; = Coord[2] :=3D (40,90) ;
 TheText[3] :=3D "Word 3" ; = Coord[3] :=3D (10,70) = ;

\stopMPinclusions

\dor= ecurse{3}{ % Frame
\startMPpage%[pagestate=3Dstart] =  
 currentime :=3D #1 = ;

 % Just for learning = :
 draw TheFrame withpen pencircle scaled .1in withcolor = magenta ;
 draw textext("T=3D"&decimal(currentime)) = scaled 2 shifted(0,2in) withcolor magenta = ;

 for k=3D1 upto = currentime: 
  draw textext(TheText[k]) shifted = Coord[k] ;
  endfor = ;
 
\stopMPpage
}

<= div>\stoptext
% 8 < = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

Fabrice. 

= --Apple-Mail=_4DB48218-4D82-4760-BE5F-74E69E9E9830-- --===============2359118680355166581== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============2359118680355166581==--