From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/112988 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio via ntg-context" Newsgroups: gmane.comp.tex.context Subject: Re: Metafun's utflen not working in certain contexts Date: Tue, 5 Oct 2021 01:08:38 -0500 Message-ID: References: <4e3adb20-8ac3-2c46-f05d-1a2779133af4@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2513715520591415784==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35066"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Jairo A. del Rio" , mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 05 08:09:25 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXddk-0008wH-3r for gctc-ntg-context-518@m.gmane-mx.org; Tue, 05 Oct 2021 08:09:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A593C283559; Tue, 5 Oct 2021 08:08:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GeMSPtZwJhhs; Tue, 5 Oct 2021 08:08:53 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D81CB287D9F; Tue, 5 Oct 2021 08:08:52 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5C5F2287D98 for ; Tue, 5 Oct 2021 08:08:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yrRzMfp5gmgR for ; Tue, 5 Oct 2021 08:08:50 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.49; helo=mail-wm1-f49.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3B722283559 for ; Tue, 5 Oct 2021 08:08:50 +0200 (CEST) Original-Received: by mail-wm1-f49.google.com with SMTP id m42so4879078wms.2 for ; Mon, 04 Oct 2021 23:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TLFAMEql0tXNREFra0edevRFzuctlZl+vCyjVAlZFKI=; b=c56q0sIKKYaJg9V03r6LCUOBiAFZ/l2MhouHAce4LiOacfhwe1gg+JEq9IMiwa7wlq aF5JGdSLodNhB5boPEpHwM0uT/GW8coG8ovMdhrlVoRDSKwGpwfz0W4IjHu+3D5iZ4Mc nMQSv/W92G4lXkVrQT4OHCi3rNInPhigwsBzr70qWnrlfyWNChByrHaAB799Lu233Ssr yJpBEe7b42iqRcBXGvgu13zNJTAC48ryjyxYYJ2LhmHRkshkk2A5RXtS0br6kYv0lYUP rA3sOPesj299mP5JhWNYebxLvsk7wtTovmdw+Vdewzh1H5nlu1yG2/ub9HG9VpcUZCKP YPFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TLFAMEql0tXNREFra0edevRFzuctlZl+vCyjVAlZFKI=; b=fOW2J1IPml20yqTFLQKRVs4sKdfVSGAmC6MHJ1r6UfIgoSZ9Dbz//7UpeA5/XrZTmr oP82v0nXqUV/k4dcnzLW2oTuldOl+alhFChkHTIAgbXlfAPyZmhIN69L/5pV3tfKkotl vuOqC4/mDwlGRyHxOmKvcH8E4BCcU9bzzRBVjpPMAOiZCLaK/Osu3T3xzj8GZDesMMJL AeJmtyNwGsgNvofccrjLF5uqGEyULvqsCdzZWHA5/IYDBwIB3fKxeBUeN+sjJF6oZlON w3DUsyBUr36r0UoGXZMuF5Kg5zzJeNCiCTLmXjGhA7dWkg2PqK6dxQmQ5sae39E2Om31 goKg== X-Gm-Message-State: AOAM533X9PTuQJ4qsa3aX7Mo5dmVYO2zgA5HmgHmkrAUjaTAIR/CNIvP +pSGd4s3kCvp0z20II7yEJ5ddeghdLDxF9VO7MU= X-Google-Smtp-Source: ABdhPJy4BuvrSlAMfZA4NkYQz2gcDIbGak+VukVGB2pvUwoGddyz+RspW19IxEqZ9bcLtPApnUyw8lfW2PnhXZDzOO0= X-Received: by 2002:a1c:7f11:: with SMTP id a17mr1404596wmd.166.1633414129794; Mon, 04 Oct 2021 23:08:49 -0700 (PDT) In-Reply-To: <4e3adb20-8ac3-2c46-f05d-1a2779133af4@xs4all.nl> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:112988 Archived-At: --===============2513715520591415784== Content-Type: multipart/alternative; boundary="000000000000fa43c305cd94dc10" --000000000000fa43c305cd94dc10 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Nice, thanks. Jairo El lun, 4 de oct. de 2021 a la(s) 13:23, Hans Hagen (j.hagen@xs4all.nl) escribi=C3=B3: > On 10/3/2021 9:28 PM, Jairo A. del Rio via ntg-context wrote: > > Hi, list. The following works for MkIV, but not LMTX (adapted from here= : > > > https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-= len-inside-a-metapost-function > > < > https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-= len-inside-a-metapost-function > >): > > > > \startMPinclusions > > > > vardef MotMystere(expr taille, speciale, index) =3D > > > > save avant,apres,case; > > > > numeric avant,apres; > > > > path case; > > > > case :=3D fullsquare scaled 13; > > > > avant :=3D speciale-1; > > > > %For Unicode, use "utflen" instead > > > > apres :=3D utflen(taille) - speciale; > > > > if avant >=3D 1: > > > > for j=3D1 upto avant: > > > > draw (case rotated 180 > > > > cutafter point 3 of case rotated 180) > > > > shifted (-13j,-13*index); > > > > endfor; > > > > fi; > > > > label.lft (index,point 3.5 of > > > > case shifted (-13*avant,-13*index)); > > > > draw case yshifted (-13*index); > > > > fill case yshifted (-13*index) > > > > withcolor \MPcolor{gray-8}; > > > > if apres > 0: > > > > for j=3D1 upto apres: > > > > draw (case cutafter point 3 of case) > > > > shifted (13j,-13*index); > > > > endfor; > > > > fi; > > > > enddef; > > > > \stopMPinclusions > > > > \starttext > > > > An example with "enigma" > > > > > > \startMPcode > > > > MotMystere("enigma",4,1) > > > > \stopMPcode > > > > \stoptext > for the moment use () > > apres :=3D (utflen(taille)) - speciale; > > > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- > --000000000000fa43c305cd94dc10 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nice, thanks.

Jairo

El lun, 4 de oct.= de 2021 a la(s) 13:23, Hans Hagen (j.= hagen@xs4all.nl) escribi=C3=B3:
On 10/3/2021 9:28 PM, Jairo A. del Rio via ntg-context = wrote:
> Hi, list. The following works for MkIV, but not LMTX (adapted from her= e:
> https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-s= tring-len-inside-a-metapost-function
> <https://tex.stackexchange.com/questions/617597/how-can-i-use-lu= as-string-len-inside-a-metapost-function>):
>
> \startMPinclusions
>
> vardef MotMystere(expr taille, speciale, index) =3D
>
> save avant,apres,case;
>
> numeric avant,apres;
>
> path case;
>
> case :=3D fullsquare scaled 13;
>
> avant :=3D speciale-1;
>
> %For Unicode, use "utflen" instead
>
> apres :=3D utflen(taille) - speciale;
>
> if avant >=3D 1:
>
> for j=3D1 upto avant:
>
> draw (case rotated 180
>
> cutafter point 3 of case rotated 180)
>
> shifted (-13j,-13*index);
>
> endfor;
>
> fi;
>
> label.lft (index,point 3.5 of
>
> case shifted (-13*avant,-13*index));
>
> draw case yshifted (-13*index);
>
> fill case yshifted (-13*index)
>
> withcolor \MPcolor{gray-8};
>
> if apres > 0:
>
> for j=3D1 upto apres:
>
> draw (case cutafter point 3 of case)
>
> shifted (13j,-13*index);
>
> endfor;
>
> fi;
>
> enddef;
>
> \stopMPinclusions
>
> \starttext
>
> An example with "enigma"
>
>
> \startMPcode
>
> MotMystere("enigma",4,1)
>
> \stopMPcode
>
> \stoptext
for the moment use ()

=C2=A0 =C2=A0 =C2=A0 =C2=A0 apres :=3D (utflen(taille)) - speciale;



-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.nl | www.= pragma-pod.nl
-----------------------------------------------------------------
--000000000000fa43c305cd94dc10-- --===============2513715520591415784== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2513715520591415784==--