From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106945 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode Date: Mon, 20 Apr 2020 11:00:47 +0200 Message-ID: References: <4c1415d6-27ce-aece-dcdf-9c67887e82eb@gmail.com> <20200420082356.GB7798@nan> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1555980404834325769==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="86100"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 20 11:01:41 2020 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 1jQSJB-000MJE-Ek for gctc-ntg-context-518@m.gmane-mx.org; Mon, 20 Apr 2020 11:01:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CC86B18337B; Mon, 20 Apr 2020 11:01:15 +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 3yO1AQ8ySo-G; Mon, 20 Apr 2020 11:01:14 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 542EC18337F; Mon, 20 Apr 2020 11:01:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CD8E518337B for ; Mon, 20 Apr 2020 11:01:12 +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 se7ZbK1aHw2s for ; Mon, 20 Apr 2020 11:01:11 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.48; helo=mail-wm1-f48.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 CD21F183340 for ; Mon, 20 Apr 2020 11:01:11 +0200 (CEST) Original-Received: by mail-wm1-f48.google.com with SMTP id t63so9076002wmt.3 for ; Mon, 20 Apr 2020 02:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ytf3vYDxTh33GGdFj1yDRB8qr5FR9gPOrs2shtTNsIY=; b=r+Eun1uAiSHH1pYtL+UM+8uZFEs6rJkDr2QSbrH0GRUDkr1NNqSReT9TOPQL+eJm4R u0URWRps1YREK9lBgErii9xG+mPdyoA96C5z8961hNePrECvBjHVbMhFuAZCOkK5AzxS WdlnGOZ/C60BZ7QiDHcmkErp6IIsa+kh2iAce0C8P5KBltpEQcGEiweklkJMV5DFDSlc sqYboKNVqq99huZ3Qqzx4bTGgPCS+KmXhE1ooPIj60UKvd2qPTpYo+jRlE0ICz04i5Td OSHI37b7C/1wtSjhkISIigVebTDZIyMPCITwmLHFXR8EaI6WKJRYeeHcX6B4rByF0c9H VuVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ytf3vYDxTh33GGdFj1yDRB8qr5FR9gPOrs2shtTNsIY=; b=Ifa3w4qSSVaRpMiFzaI30rwTSst1h98uCpsx4jW0jlBJLXduXYTuSvuwP9W6NSthIh kePn4bBFdN7REQnTO0hk1JWjaqTnnvxGFA/NgE/lym9/RWVpdbOnNSuMxZWA57f8BrgB /ewhYgjixQ5uPdMbTINNYm/AG2MI4vqG+/pPj8853sONuiZUr1skIiTbT1g31GFEwbBr KVtUX18bSFr5LCIz30rkFezv9kBS9hGNAQWMzIcucqQDF4yJ2oieFXqBozlipRB02FG2 usihjHuUyqRpHMgiM4Pw/revNGWUfM+BRWc6g0ZOpEhmtk329iyfyvmKNMgPmrpd9a85 rPoA== X-Gm-Message-State: AGi0PubV/7bq6mAievSO4YgaQKUOZluozvfniqT9t1uUzwvhYyLoZtiv Je9I507DBY7A5i8PlPf9U7IDFj9qzOGiqNxKudT3nIot X-Google-Smtp-Source: APiQypKeqK7rvQkoDrhgkIL8guNXelfd/+2BSkVdgcKkTTbdeRuqttg8fEgmRx4AIFIA86z9rvILsKEfN1UH50ODWF0= X-Received: by 2002:a1c:7215:: with SMTP id n21mr17462007wmc.145.1587373271299; Mon, 20 Apr 2020 02:01:11 -0700 (PDT) In-Reply-To: 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:106945 Archived-At: --===============1555980404834325769== Content-Type: multipart/alternative; boundary="000000000000f63b6805a3b52387" --000000000000f63b6805a3b52387 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Wolfgang, Thank you very much ; as usual your explanations are always clear and your approach to the problem intelligent and original. I would however like to know the way in which we can use the command \frameletter except for the rounded corners with outlinetext. For example, this doesn't work. \startMPcode draw outlinetext.f ("\frameletter{A}") (withcolor darkred withpen pencircle scaled 1/10) rotated 5 xsized 2cm ; \stopMPcode Fabrice Le lun. 20 avr. 2020 =C3=A0 10:36, Wolfgang Schuster < wolfgang.schuster.lists@gmail.com> a =C3=A9crit : > Rudolf Bahr schrieb am 20.04.2020 um 10:23: > > On Mon, Apr 20, 2020 at 09:21:41AM +0200, Wolfgang Schuster wrote: > >> Fabrice Couvreur schrieb am 19.04.2020 um 22:55: > >>> Hi, > >>> I try to reproduce the figure as faithfully as possible. I tried for > the > >>> rounded corners to put the key corner =3D round, but it does not work= . > >> > >> 1. To create a new framed-instance you need \defineframe, \setupframed > isn't > >> enough to set the values. > >> > >> I guess you assumed this works similar to xtables but this > mechanism sets > >> a few values to assure \setupxtable is enough in certain cases but eve= n > here > >> you need \definextable in certain cases. > >> > >> When you create a new instance you have to use the name of the new > >> instance as command name, e.g. \frameletter or use the \placeframed > command > >> which takes the name as argument, e.g. \placeframed[frameletter]. > >> > >> 2. You can't pass the name of a framed-instance to \framed (backwards > >> compatibility, performance ...), this is only possible with > \startframed. > >> > >> 3. ConTeXt uses different mechanism to draw rectangular (unless you > draw a > >> closed frame) and rounded frame and the mechanism for rounded frames > doesn't > >> work with outlinetext. > >> > >> 4. To achieve the desired result you can now a) use MetaPost to draw t= he > >> complete card (letter plus frame) or b) use only TeX to put the letter > in a > >> frame and rotate it. > >> > >> %%%% begin tex example > >> \usecolors[svg] > >> > >> \defineframed > >> [frameletter] > >> [width=3D1.25em, > >> height=3D1.75em, > >> foregroundstyle=3D\ssbfc, > >> corner=3Dround, > >> radius=3D0.1\bodyfontsize, > >> rulethickness=3D1pt] > >> > >> \starttext > >> > >> \startTEXpage[offset=3D\linewidth] > >> \dontleavehmode > >> \rotate [rotation=3D5] {\color[darkred] {\frameletter{A}}} > >> \rotate [rotation=3D-5]{\color[green] {\frameletter{L}}} > >> \rotate [rotation=3D5] {\color[mediumblue]{\frameletter{E}}} > >> \rotate [rotation=3D-5]{\color[darkviolet]{\frameletter{A}}} > >> \stopTEXpage > >> > >> \stoptext > >> %%%% end tex example > >> > >> Wolfgang > > > > Nice Example and good explanation, Wolfgang. But why did you use the > command > > "dontleavehmode"? It doesn't seem to be necessary in this example. > > I wrote the example without TeXpage where I needed \doneleavehmode to > keep all cards on the same line. At the end I just added TeXpage to > create a cropped image with with a small border and forgot to remove it. > > Wolfgang > > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --000000000000f63b6805a3b52387 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Wolfgang,
Thank you very much ; as usual your explanations are always clear and your approach t= o the problem intelligent and original. I would how= ever like to know the way in which we can use the command \frameletter exce= pt for the rounded corners with outlinetext. For example, this doesn't = work.

\startMPcode
=C2=A0 =C2=A0 =C2=A0draw outlinetext.f
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0("\frameletter{A}")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(= withcolor darkred withpen pencircle scaled 1/10)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 rotated 5 xsized 2cm ;

= \stopMPcode

Fabrice

Le=C2=A0lun. 20 avr. 2020 =C3= =A0=C2=A010:36, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> a =C3=A9crit=C2= =A0:
Rudolf Bahr= schrieb am 20.04.2020 um 10:23:
> On Mon, Apr 20, 2020 at 09:21:41AM +0200, Wolfgang Schuster wrote:
>> Fabrice Couvreur schrieb am 19.04.2020 um 22:55:
>>> Hi,
>>> I try to reproduce the figure as faithfully as possible. I tri= ed for the
>>> rounded corners to put the key corner =3D round, but it does n= ot work.
>>
>> 1. To create a new framed-instance you need \defineframe, \setupfr= amed isn't
>> enough to set the values.
>>
>>=C2=A0 =C2=A0 =C2=A0I guess you assumed this works similar to xtabl= es but this mechanism sets
>> a few values to assure \setupxtable is enough in certain cases but= even here
>> you need \definextable in certain cases.
>>
>>=C2=A0 =C2=A0 =C2=A0When you create a new instance you have to use = the name of the new
>> instance as command name, e.g. \frameletter or use the \placeframe= d command
>> which takes the name as argument, e.g. \placeframed[frameletter].<= br> >>
>> 2. You can't pass the name of a framed-instance to \framed (ba= ckwards
>> compatibility, performance ...), this is only possible with \start= framed.
>>
>> 3. ConTeXt uses different mechanism to draw rectangular (unless yo= u draw a
>> closed frame) and rounded frame and the mechanism for rounded fram= es doesn't
>> work with outlinetext.
>>
>> 4. To achieve the desired result you can now a) use MetaPost to dr= aw the
>> complete card (letter plus frame) or b) use only TeX to put the le= tter in a
>> frame and rotate it.
>>
>> %%%% begin tex example
>> \usecolors[svg]
>>
>> \defineframed
>>=C2=A0 =C2=A0 [frameletter]
>>=C2=A0 =C2=A0 [width=3D1.25em,
>>=C2=A0 =C2=A0 =C2=A0height=3D1.75em,
>>=C2=A0 =C2=A0 =C2=A0foregroundstyle=3D\ssbfc,
>>=C2=A0 =C2=A0 =C2=A0corner=3Dround,
>>=C2=A0 =C2=A0 =C2=A0radius=3D0.1\bodyfontsize,
>>=C2=A0 =C2=A0 =C2=A0rulethickness=3D1pt]
>>
>> \starttext
>>
>> \startTEXpage[offset=3D\linewidth]
>> \dontleavehmode
>> \rotate [rotation=3D5] {\color[darkred]=C2=A0 =C2=A0{\frameletter{= A}}}
>> \rotate [rotation=3D-5]{\color[green]=C2=A0 =C2=A0 =C2=A0{\framele= tter{L}}}
>> \rotate [rotation=3D5] {\color[mediumblue]{\frameletter{E}}}
>> \rotate [rotation=3D-5]{\color[darkviolet]{\frameletter{A}}}
>> \stopTEXpage
>>
>> \stoptext
>> %%%% end tex example
>>
>> Wolfgang
>
> Nice Example and good explanation, Wolfgang. But why did you use the c= ommand
> "dontleavehmode"? It doesn't seem to be necessary in thi= s example.

I wrote the example without TeXpage where I needed \doneleavehmode to
keep all cards on the same line. At the end I just added TeXpage to
create a cropped image with with a small border and forgot to remove it.
Wolfgang

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--000000000000f63b6805a3b52387-- --===============1555980404834325769== 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== --===============1555980404834325769==--