From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110086 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Garulfo Newsgroups: gmane.comp.tex.context Subject: drop shadows with metapost/ metafun Date: Tue, 29 Dec 2020 22:56:40 +0100 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (1.0) Content-Type: multipart/mixed; boundary="===============6706031711642374659==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6282"; mail-complaints-to="usenet@ciao.gmane.io" To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 29 22:57:08 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 1kuMzM-0001VM-8D for gctc-ntg-context-518@m.gmane-mx.org; Tue, 29 Dec 2020 22:57:08 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5E1481C1540; Tue, 29 Dec 2020 22:56: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 sG0oP2sklX9x; Tue, 29 Dec 2020 22:56:49 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6FE6A1C171C; Tue, 29 Dec 2020 22:56:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5782B1C16C6 for ; Tue, 29 Dec 2020 22:56:48 +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 pyH8KXwPaSMw for ; Tue, 29 Dec 2020 22:56:47 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=82.64.235.169; helo=azules.eu; envelope-from=garulfo@azules.eu; receiver= Original-Received: from azules.eu (82-64-235-169.subs.proxad.net [82.64.235.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 9C1C51C1540 for ; Tue, 29 Dec 2020 22:56:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=azules.eu; s=mailkey; t=1609279002; bh=DlksWi9pVAmgWtgld/3uc6MvS7a6bfr45AoKDm9nWmg=; h=From:Date:Subject:To; b=pvg/vb82TrCEv+zWFOPlc6ZAR+V5D5mPOJeQ3BIfTmMdxYyEHyq3YrUbc5n7c5dew UfJx/AON59v4tAmrpndjSpOiEhhArBtPB4nG+kNlcyGGSq9RPbd3k7vl86JSwiGzj6 EH5R4m28TmY87ciDOEu/AaOabHz77EdnAl7v4L74= X-MailScanner-ID: 8349E545D08.A40FE X-MailScanner: Found to be clean X-MailScanner-From: garulfo@azules.eu 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:110086 Archived-At: --===============6706031711642374659== Content-Type: multipart/alternative; boundary=Apple-Mail-62732E6A-B943-4CD1-BA40-2719A94505C5 Content-Transfer-Encoding: 7bit --Apple-Mail-62732E6A-B943-4CD1-BA40-2719A94505C5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Which process would you advice to add =C2=AB drop shadows =C2=BB to any kind= of metafun / metapost figures like: picture p; p :=3D textext("MetaPost is fun!") shifted (10cm,10cm); My current understanding of the required steps : 1- fill p with the shadow color 2- write it to an external metapost file (with savebuffer ?) ready for png e= xport (outputformat :=3D "png =C2=BB;) 3- with lua, os.execute, and imagemagick prepare the shadow - extent the png file with a transparent background, to have room for blur= ring=20 - blur it 4- import this png in context / Metapost (externalfigure), and center it wit= h p figure 5- shift it according to the desired shadows distance and angle 6- apply the initial bounding box of p to the shadow, draw the shadow, draw t= he p picture=20 Actually, all this seems long and tedious, and contrasts with the already ex= isting links between MetaPost / MetaFun and cairo + libpng. Thanks again for your help.= --Apple-Mail-62732E6A-B943-4CD1-BA40-2719A94505C5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Which process would y= ou advice to add =C2=AB drop shadows =C2=BB to any kind of metafun / me= tapost figures like:
picture p;
p :=3D textext("MetaPost is fun!") shifted (10cm,10cm);

My current understanding of the required steps :
=


1- fill p= with the shadow color

2- wri= te it to an external metapost file (with savebuffer ?) ready for png export (= outputformat :=3D "png =C2=BB;)=

3- with lua, os.execute, and= imagemagick prepare the shadow
- extent the png file= with a transparent background, to have room for blurring
- blur it

4- import this= png in context / Metapost (externalfigure), and center it with p figure

5- shift it according to the des= ired shadows distance and angle

6- apply the initial bounding box of p to the shadow, draw the shadow, dr= aw the p picture

=
Actually, all this seems long and tedio= us, and contrasts with the already existing links between MetaPost / Me= taFun and cairo + libpng.

Thanks again f= or your help.
= --Apple-Mail-62732E6A-B943-4CD1-BA40-2719A94505C5-- --===============6706031711642374659== 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== --===============6706031711642374659==--