From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/105657 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Transparency (Metapost) Date: Sun, 1 Dec 2019 21:56:05 +0100 Message-ID: References: <82D114A8-03DF-4492-BA46-C9CF30FF11D2@me.com> <5c344b90-51ad-b338-df9d-4db1ce9934d0@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4234216183912145548==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="88312"; mail-complaints-to="usenet@blaine.gmane.org" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Dec 01 21:58:23 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ibWIQ-000Mpx-Up for gctc-ntg-context-518@m.gmane.org; Sun, 01 Dec 2019 21:58:23 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1F310163636; Sun, 1 Dec 2019 21:57:54 +0100 (CET) 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 DwyajfOZ0_Xz; Sun, 1 Dec 2019 21:57:52 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3E78F163897; Sun, 1 Dec 2019 21:57:52 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3D623163895 for ; Sun, 1 Dec 2019 21:57:50 +0100 (CET) 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 LF8BKzlKkTZ5 for ; Sun, 1 Dec 2019 21:57:49 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.42; helo=mail-wm1-f42.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 3BDE5163636 for ; Sun, 1 Dec 2019 21:57:49 +0100 (CET) Original-Received: by mail-wm1-f42.google.com with SMTP id g206so19621702wme.1 for ; Sun, 01 Dec 2019 12:57:49 -0800 (PST) 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=FNrKJ8c5pBVFp80zdV55ApA3i+th6e41XE/ZywB+11g=; b=Y1k/83OLwSopzM5GbujrslzM6LbB0RiB9NmotOMds+E6g7goNAzj/O+vTW0x8nM3FX HVpUTCx2K0Fupd1yu0pC0wYxbhq0oS7WnnG7VPIpAEBU4xHmMIX+aDlpLGEUfAIPNISR I2rwMdrSO1cGLEDnC/xBm0R8K31cn9DxETPUH1wZF3GaUtkovUQ7Ly9pwnQcfF0X4YJh vR2CyMzF7P6vtuTVadQY+TiJlfEy2hzz7U+ru2dktRqHAAaXApasldGmXiIqsIukByXF ZWXk7f9gBl67GQh4YiKuKoTklznfzvKK4FpT28CWHidp9mpy0OjfC4EnOnV3A0tkjbZ9 XUsA== 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=FNrKJ8c5pBVFp80zdV55ApA3i+th6e41XE/ZywB+11g=; b=N6SMlcaKgcF/l5GXsQT1nnztHaUKgi+Da5U6aaenk+Q5XZp7b+zpVZOmfnVqAYzRUf SM48kB96lx7n2tv7SD7jPd/jjT5p/ZKpDT+9+rpep0j9zZVmAXvTgB4Y8rQ6TAnYOg5j xH0mU4DYtULMrHtA0GxqFCO+0SjiZdh/hTISl5Wm4FiZ7NME11pCagavcXmmiCIoZb4W xRQ8H5yDyktge/MoFOtbOxxQLNxCDlxvHXb5ldabJU1kdc70PUsS/KfvOv0w+CyT+NE5 kHz+XqVfNKwQKuQGcHDoI9xe5rA8lRkruJRPl6V+SIbti45VWGhHeIPzVm7A7sqkXpTE pD0Q== X-Gm-Message-State: APjAAAUvU8FBwAPwu/VuvUZSqoeWaDmqlJsmyXttO1Rjdnphb7j/N7mn gDCB7cI5V+4b3USQogVTUwgsVnofQfhQO7B0hnjldz+4 X-Google-Smtp-Source: APXvYqxjitqPzKsW35Gmj4iSExA40G1dK/WnbIG54svAH/ZTL6gQjXmSa3Z+6VBJLt+9b6HFjEEBddSLuk3r2A0cC2w= X-Received: by 2002:a7b:cb54:: with SMTP id v20mr24290200wmj.11.1575233868329; Sun, 01 Dec 2019 12:57:48 -0800 (PST) In-Reply-To: <5c344b90-51ad-b338-df9d-4db1ce9934d0@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.org gmane.comp.tex.context:105657 Archived-At: --===============4234216183912145548== Content-Type: multipart/alternative; boundary="00000000000028f6bb0598aab749" --00000000000028f6bb0598aab749 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Hans, I updated lmtx, but your code does not compile except that the output is a pdf file where it is written ERROR. Fabrice tex error > tex error on line 1 in file ./blond.tex: ? \font_helpers_low_level_define ...\scaledfontmode \relax \ifcase \scaledfont... \font_helpers_trigger_define ..._identifier_class \csname \v_font_identifier... \applyfontclassstrategies ...to_size \lastnamedcs \else \expandafter \font_h... \font_helpers_synchronize_font ...classstrategies \fi \setfalse \c_font_auto... \rm ->\ifmmode \mathrm \else \normalrm \fi \font_basics_switch_style ...dcsname \lastnamedcs \edef \fontstyle {#1}\ifmm... ... l.1 \starttext 1 >> \starttext 2 3 \startMPcode 4 defaultfont :=3D "texgyrepagella-regular*default" ; 5 defaultscale :=3D 0.8 ; 6 7 definecolor [ name =3D "mp:red", b =3D 1 ] ; 8 definecolor [ name =3D "mp:green", y =3D 1 ] ; 9 10 path twos, threes ; 11 twos :=3D fullcircle xscaled 4cm yscaled 2cm rotated 180 shift= ed 42 mtx-context | fatal error: return code: 256 Le dim. 1 d=C3=A9c. 2019 =C3=A0 13:09, Hans Hagen a =C3= =A9crit : > On 12/1/2019 11:32 AM, Fabrice Couvreur wrote: > > Hello > > Thank you for your suggestion. However, it works with context and not > > with lmtx. > > Fabrice > > > > \starttext > > \startMPcode > > defaultfont :=3D "texgyrepagella-regular*default" ; > > defaultscale :=3D0.8; > > > > color brown; > > brown =3D (0.128,0.00,0.00); > > > > path twos, threes, sixes; > > twos =3D fullcircle xscaled 4cm yscaled 2cm rotated 180 > > shifted 42 left; > > threes =3D fullcircle xscaled 4cm yscaled 2cm shifted 42 right; > > sixes =3D buildcycle(twos, threes); > > > > fill twos withcolor brown withtransparency(1,0.75); > > fill threes withcolor yellow withtransparency(1,0.75); > > fill sixes withcolor yellow + brown withtransparency(1,0.75); > > > > draw twos; > > draw threes; > > > > label("...",(1.5cm,0)); > > label("...",(0,0)); > > label("...",(-1.5cm,0)); > > label.top("yeux marron",(-1.5cm,1.25cm)); > > label.top("cheveux blonds",(1.5cm,1.25cm)); > > \stopMPcode > > \stoptext > > > > tex error > tex error on line 1 in file ./blond.tex: ? > Looks ok here ... but isn't the transparacy used instead of the sizes? > Anyway, you can use named colors > > \starttext > > \startMPcode > defaultfont :=3D "texgyrepagella-regular*default" ; > defaultscale :=3D 0.8 ; > > definecolor [ name =3D "mp:red", b =3D 1 ] ; > definecolor [ name =3D "mp:green", y =3D 1 ] ; > > path twos, threes ; > twos :=3D fullcircle xscaled 4cm yscaled 2cm rotated 180 shifted 42 > left ; > threes :=3D fullcircle xscaled 4cm yscaled 2cm shifted 42 > right ; > > fill twos withcolor "mp:red" withtransparency(1,0.5) ; > fill threes withcolor "mp:green" withtransparency(1,0.5) ; > > draw twos ; > draw threes ; > > label("...",( 1.5cm,0)); > label("...",( 0, 0)); > label("...",(-1.5cm,0)); > label.top("\strut yeux marron", (-1.5cm,1.25cm)); > label.top("\strut cheveux blonds",( 1.5cm,1.25cm)); > \stopMPcode > > \stoptext > > (you cannot overload colors at the tex level in mp but use them in order > to be consistent) > > Hans > > ----------------------------------------------------------------- > 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 > > _________________________________________________________________________= __________ > --00000000000028f6bb0598aab749 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Hans,
I updated lmtx, but your code does not compile except t= hat the output is a pdf file where it is written ERROR.
Fabrice

tex error =C2=A0 =C2=A0 =C2=A0 > tex= error on line 1 in file ./blond.tex: ?


\font_helpers_low_level_= define ...\scaledfontmode
=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=A0 =C2=A0 =C2=A0 =C2=A0 \relax \ifcase \sca= ledfont...
\font_helpers_trigger_define ..._identifier_class
=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=A0 = =C2=A0 =C2=A0 =C2=A0 \csname \v_font_identifier...
\applyfontclassstrate= gies ...to_size \lastnamedcs
=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=A0 =C2=A0 =C2=A0 =C2=A0 \else \expandaf= ter \font_h...
\font_helpers_synchronize_font ...classstrategies
=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= =A0 =C2=A0 =C2=A0 =C2=A0 \fi \setfalse \c_font_auto...
\rm ->\ifmmode= \mathrm \else \normalrm
=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\fi
\font_basics_switch_style ...dcsname \lastnamed= cs
=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=A0 =C2=A0 =C2=A0 =C2=A0 \edef \fontstyle {#1}\ifmm...
...
= l.1 \starttext
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

=C2=A01= >> =C2=A0\starttext
=C2=A02 =C2=A0 =C2=A0
=C2=A03 =C2=A0 =C2= =A0 \startMPcode
=C2=A04 =C2=A0 =C2=A0 =C2=A0 =C2=A0 defaultfont =C2=A0:= =3D "texgyrepagella-regular*default" ;
=C2=A05 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 defaultscale :=3D 0.8 ;
=C2=A06 =C2=A0 =C2=A0
=C2=A07 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 definecolor [ name =3D "mp:red", =C2= =A0 b =3D 1 ] ;
=C2=A08 =C2=A0 =C2=A0 =C2=A0 =C2=A0 definecolor [ name = =3D "mp:green", y =3D 1 ] ;
=C2=A09 =C2=A0 =C2=A0
10 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 path twos, threes ;
11 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 twos =C2=A0 :=3D fullcircle xscaled 4cm yscaled 2cm rotated 180 shifted= 42

mtx-context =C2=A0 =C2=A0 | fatal error: return code: 256
<= /div>
L= e=C2=A0dim. 1 d=C3=A9c. 2019 =C3=A0=C2=A013:09, Hans Hagen <j.hagen@xs4all.nl> a =C3=A9crit=C2=A0:
<= /div>
On 12/1/2019 11:32 A= M, Fabrice Couvreur wrote:
> Hello
> Thank you for your suggestion. However, it works with context and not =
> with lmtx.
> Fabrice
>
> \starttext
> \startMPcode
>=C2=A0 =C2=A0 =C2=A0defaultfont :=3D "texgyrepagella-regular*defau= lt" ;
>=C2=A0 =C2=A0 =C2=A0defaultscale :=3D0.8;
>
>=C2=A0 =C2=A0 =C2=A0color brown;
>=C2=A0 =C2=A0 =C2=A0brown =3D (0.128,0.00,0.00);
>
>=C2=A0 =C2=A0 =C2=A0path twos, threes, sixes;
>=C2=A0 =C2=A0 =C2=A0twos =3D fullcircle xscaled 4cm yscaled 2cm rotated= 180
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 shifted 42 left;
>=C2=A0 =C2=A0 =C2=A0threes =3D fullcircle xscaled 4cm yscaled 2cm shift= ed 42 right;
>=C2=A0 =C2=A0 =C2=A0sixes =3D buildcycle(twos, threes);
>
>=C2=A0 =C2=A0 =C2=A0fill twos =C2=A0 withcolor brown withtransparency(1= ,0.75);
>=C2=A0 =C2=A0 =C2=A0fill threes withcolor yellow withtransparency(1,0.7= 5);
>=C2=A0 =C2=A0 =C2=A0fill sixes withcolor yellow + brown withtransparenc= y(1,0.75);
>
>=C2=A0 =C2=A0 =C2=A0draw twos;
>=C2=A0 =C2=A0 =C2=A0draw threes;
>
>=C2=A0 =C2=A0 =C2=A0label("...",(1.5cm,0));
>=C2=A0 =C2=A0 =C2=A0label("...",(0,0));
>=C2=A0 =C2=A0 =C2=A0label("...",(-1.5cm,0));
>=C2=A0 =C2=A0 =C2=A0label.top("yeux marron",(-1.5cm,1.25cm));=
>=C2=A0 =C2=A0 =C2=A0label.top("cheveux blonds",(1.5cm,1.25cm)= );
> \stopMPcode
> \stoptext
>
> tex error =C2=A0 =C2=A0 =C2=A0 > tex error on line 1 in file ./blon= d.tex: ?
Looks ok here ... but isn't the transparacy used instead of the sizes? =
Anyway, you can use named colors

\starttext

\startMPcode
=C2=A0 =C2=A0 defaultfont=C2=A0 :=3D "texgyrepagella-regular*default&q= uot; ;
=C2=A0 =C2=A0 defaultscale :=3D 0.8 ;

=C2=A0 =C2=A0 definecolor [ name =3D "mp:red",=C2=A0 =C2=A0b =3D = 1 ] ;
=C2=A0 =C2=A0 definecolor [ name =3D "mp:green", y =3D 1 ] ;

=C2=A0 =C2=A0 path twos, threes ;
=C2=A0 =C2=A0 twos=C2=A0 =C2=A0:=3D fullcircle xscaled 4cm yscaled 2cm rota= ted 180 shifted 42
left ;
=C2=A0 =C2=A0 threes :=3D fullcircle xscaled 4cm yscaled 2cm=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shifted 42
right ;

=C2=A0 =C2=A0 fill twos=C2=A0 =C2=A0withcolor "mp:red"=C2=A0 =C2= =A0withtransparency(1,0.5) ;
=C2=A0 =C2=A0 fill threes withcolor "mp:green" withtransparency(1= ,0.5) ;

=C2=A0 =C2=A0 draw twos ;
=C2=A0 =C2=A0 draw threes ;

=C2=A0 =C2=A0 label("...",( 1.5cm,0));
=C2=A0 =C2=A0 label("...",( 0,=C2=A0 =C2=A0 0));
=C2=A0 =C2=A0 label("...",(-1.5cm,0));
=C2=A0 =C2=A0 label.top("\strut yeux marron",=C2=A0 =C2=A0(-1.5cm= ,1.25cm));
=C2=A0 =C2=A0 label.top("\strut cheveux blonds",( 1.5cm,1.25cm));=
\stopMPcode

\stoptext

(you cannot overload colors at the tex level in mp but use them in order to be consistent)

Hans

-----------------------------------------------------------------
=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
-----------------------------------------------------------------
___________________________________________________________________________= ________
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
___________________________________________________________________________= ________
--00000000000028f6bb0598aab749-- --===============4234216183912145548== 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== --===============4234216183912145548==--