From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97125 Path: news.gmane.org!.POSTED!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: A better \definesymbol sought Date: Fri, 20 Jan 2017 22:33:40 -0500 Message-ID: <348a2b7f-e3ff-ce93-e0e9-ca14b9440306@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3201536064582027562==" X-Trace: blaine.gmane.org 1484969673 8913 195.159.176.226 (21 Jan 2017 03:34:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jan 2017 03:34:33 +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 Sat Jan 21 04:34:28 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 1cUmRe-0001kl-S5 for gctc-ntg-context-518@m.gmane.org; Sat, 21 Jan 2017 04:34:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E982812600E7; Sat, 21 Jan 2017 04:34:01 +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 D2FpWDquIEAL; Sat, 21 Jan 2017 04:33:59 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id AEBC41260089; Sat, 21 Jan 2017 04:33:59 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E946A1260089 for ; Sat, 21 Jan 2017 04:33:57 +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 PgB1MTfuS5dT for ; Sat, 21 Jan 2017 04:33:56 +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 B18A71260062 for ; Sat, 21 Jan 2017 04:33:46 +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 4748B13E00 for ; Fri, 20 Jan 2017 22:33:44 -0500 (EST) 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:97125 Archived-At: This is a multi-part message in MIME format. --===============3201536064582027562== Content-Type: multipart/alternative; boundary="------------EADDF22F7B11085C9A4D3B9F" This is a multi-part message in MIME format. --------------EADDF22F7B11085C9A4D3B9F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit ConTeXters, I have been using \definesymbol for a while, and for most purposes it suffices. However, there is one thing that it does not do that perhaps it should. What it does not do is offer the option to center one glyph over another (horizontally and/or vertically) when it should be centered. Rather, it leaves the work to a process of tuning the horizontal and vertical levers (kern and raise here) to get something that is close, but rarely perfect. I also see some problems with the horizontal spacing around the new symbol, but that may be a function of the underlying glyphs here. The following example shows what I mean \definefont [Inits] [dejavusans] \usesymbols[mvs] \define\SqSteel{% \tfc \symbol[martinvogel 2][SquareSteel] } \define\RedSansA{% \tfx \Inits{\red A} } \definesymbol [MyMark] [\SqSteel\kern-.87em{\raise.38ex\hbox{\RedSansA}}] \define\Test{Some text \symbol[MyMark] some more text.\par} \starttext \Test \setupbodyfont[8pt] \Test \setupbodyfont[18pt] \Test \scale[factor=40]{\Test} \stoptext 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? -- Rik --------------EADDF22F7B11085C9A4D3B9F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

ConTeXters,

I have been using \definesymbol for a while, and for most purposes it suffices. However, there is one thing that it does not do that perhaps it should.

What it does not do is offer the option to center one glyph over another (horizontally and/or vertically) when it should be centered. Rather, it leaves the work to a process of tuning the horizontal and vertical levers (kern and raise here) to get something that is close, but rarely perfect.

I also see some problems with the horizontal spacing around the new symbol, but that may be a function of the underlying glyphs here.

The following example shows what I mean

\definefont
  [Inits]
  [dejavusans]
\usesymbols[mvs]
\define\SqSteel{%
  \tfc
  \symbol[martinvogel 2][SquareSteel]
}
\define\RedSansA{%
  \tfx
  \Inits{\red A}
}
\definesymbol
  [MyMark]
  [\SqSteel\kern-.87em{\raise.38ex\hbox{\RedSansA}}]
\define\Test{Some text \symbol[MyMark] some more text.\par}

\starttext
\Test
\setupbodyfont[8pt]
\Test
\setupbodyfont[18pt]
\Test
\scale[factor=40]{\Test}
\stoptext

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?

--
Rik

--------------EADDF22F7B11085C9A4D3B9F-- --===============3201536064582027562== 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 --===============3201536064582027562==--