From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97134 Path: news.gmane.org!.POSTED!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: A better \definesymbol sought Date: Sun, 22 Jan 2017 22:39:53 -0500 Message-ID: References: <348a2b7f-e3ff-ce93-e0e9-ca14b9440306@rik.users.panix.com> <20170120215443.62bbdfb2@zoo.hsd1.co.comcast.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2188961096429473713==" X-Trace: blaine.gmane.org 1485142854 29948 195.159.176.226 (23 Jan 2017 03:40:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 23 Jan 2017 03:40:54 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 23 04:40:46 2017 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 esmtp (Exim 4.84_2) (envelope-from ) id 1cVVUm-0006mC-L6 for gctc-ntg-context-518@m.gmane.org; Mon, 23 Jan 2017 04:40:40 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 517BD100F09; Mon, 23 Jan 2017 04:40:11 +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 hJ1cv8TguIMe; Mon, 23 Jan 2017 04:40:09 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id C27F1100F01; Mon, 23 Jan 2017 04:40:09 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 88A37100EF9 for ; Mon, 23 Jan 2017 04:40:08 +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 b4BM2RV5_QnU for ; Mon, 23 Jan 2017 04:40:06 +0100 (CET) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 0D7D1100EF4 for ; Mon, 23 Jan 2017 04:39:56 +0100 (CET) Original-Received: from [192.168.201.10] (cpe-24-194-22-135.nycap.res.rr.com [24.194.22.135]) by mailbackend.panix.com (Postfix) with ESMTPSA id DCE7313BFA for ; Sun, 22 Jan 2017 22:39:54 -0500 (EST) In-Reply-To: <20170120215443.62bbdfb2@zoo.hsd1.co.comcast.net> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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:97134 Archived-At: This is a multi-part message in MIME format. --===============2188961096429473713== Content-Type: multipart/alternative; boundary="------------06816025CB08407CFE24BF3F" This is a multi-part message in MIME format. --------------06816025CB08407CFE24BF3F Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2017-01-20 23:54, Alan Braslau wrote: > On Fri, 20 Jan 2017 22:33:40 -0500 > Rik Kabel wrote: > >> Can anyone suggest a better way to compose such symbols than using >> the raw TeX commands used here? Is there a more ConTeXt-ish way to do >> this? Is it possible to get options to center the glyphs from which >> the symbol is assembled (separate horizontal and vertical, with the >> ability to offset them)? >> >> Is there a ConTeXt way other than \definesymbol to create such >> combined symbols? > MetaPost (with textext())? Thank you for that, Alan. I hadn’t ever used MetaPost before, thinking it was too complex for my needs. Now I see it may be quite useful. So, how can I make the inner glyph (‘?’ in the example below) transparent, so that the background shows through along with anything else that lives on a lower layer? I’ve seen a method for constructed shapes, but nothing that I can apply to text glyphs. Undraw doesn’t do it. \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf] \startuseMPgraphic{HeartTest} picture h; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20; picture q; q := textext("{\DVSrB ?}") scaled 10; % just a different way q := q shifted - (xpart center q, 12pt) ; draw h withcolor blue; undraw q; % this doesn't do it \stopuseMPgraphic \starttext \useMPgraphic{HeartTest} \stoptext -- Rik --------------06816025CB08407CFE24BF3F Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2017-01-20 23:54, Alan Braslau wrote:
On Fri, 20 Jan 2017 22:33:40 -0500
Rik Kabel <context@rik.users.panix.com> wrote:

Can anyone suggest a better way to compose such symbols than using
the raw TeX commands used here? Is there a more ConTeXt-ish way to do
this? Is it possible to get options to center the glyphs from which
the symbol is assembled (separate horizontal and vertical, with the
ability to offset them)?

Is there a ConTeXt way other than \definesymbol to create such
combined symbols?
MetaPost (with textext())?

Thank you for that, Alan. I hadn’t ever used MetaPost before, thinking it was too complex for my needs. Now I see it may be quite useful.

So, how can I make the inner glyph (‘?’ in the example below) transparent, so that the background shows through along with anything else that lives on a lower layer? I’ve seen a method for constructed shapes, but nothing that I can apply to text glyphs. Undraw doesn’t do it.

  \setupbackgrounds
   [page]
   [background=color,backgroundcolor=yellow]
 \definefont
   [DVSrB]
   [file:DejaVuSerif-Bold.ttf]
 \startuseMPgraphic{HeartTest}
   picture h;
   h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20;
   picture q;
   q := textext("{\DVSrB ?}") scaled 10;     % just a different way
   q := q shifted - (xpart center q, 12pt) ;
   draw h withcolor blue;
   undraw q;                                   % this doesn't do it
 \stopuseMPgraphic
 \starttext
   \useMPgraphic{HeartTest}
 \stoptext

--
Rik

--------------06816025CB08407CFE24BF3F-- --===============2188961096429473713== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============2188961096429473713==--