From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113004 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Rudd, Kevin via ntg-context" Newsgroups: gmane.comp.tex.context Subject: Outlined text (from MP) inline in ConText has incorrect baseline (i.e. no depth) Date: Thu, 7 Oct 2021 14:14:56 +0000 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6657438342126600352==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22359"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Rudd, Kevin" , "Kevin W. Rudd" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 07 16:31:14 2021 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 1mYUQS-0005UU-CI for gctc-ntg-context-518@m.gmane-mx.org; Thu, 07 Oct 2021 16:31:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7E9A0287E1A; Thu, 7 Oct 2021 16:30:30 +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 b5tVyTWFSDVS; Thu, 7 Oct 2021 16:30:28 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BCC02287EBF; Thu, 7 Oct 2021 16:30:28 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 50E8C287E21 for ; Thu, 7 Oct 2021 16:30:27 +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 WmgqiK0CHATR for ; Thu, 7 Oct 2021 16:30:25 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=129.2.108.16; helo=smtp.lps.umd.edu; envelope-from=kevin@lps.umd.edu; receiver= X-Greylist: delayed 906 seconds by postgrey-1.36 at zapf.ntg.nl; Thu, 07 Oct 2021 16:30:25 CEST Original-Received: from SMTP.lps.umd.edu (smtp.lps.umd.edu [129.2.108.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3A25C287E1A for ; Thu, 7 Oct 2021 16:30:24 +0200 (CEST) Original-Received: from LPS-ExchDB2.lps.umd.edu (129.2.108.18) by SMTP.lps.umd.edu (129.2.108.16) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 7 Oct 2021 10:15:17 -0400 Original-Received: from LPS-ExchDB1.lps.umd.edu (2002:8102:6c11::8102:6c11) by LPS-ExchDB2.lps.umd.edu (2002:8102:6c12::8102:6c12) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 7 Oct 2021 10:14:56 -0400 Original-Received: from LPS-ExchDB1.lps.umd.edu ([129.2.108.17]) by LPS-ExchDB1.lps.umd.edu ([129.2.108.17]) with mapi id 15.00.1497.012; Thu, 7 Oct 2021 10:14:56 -0400 Thread-Topic: Outlined text (from MP) inline in ConText has incorrect baseline (i.e. no depth) Thread-Index: AQHXu4W0eFh5pnEJjUmoJR7u8hJmbQ== Accept-Language: en-US Content-Language: en-US x-mailer: Apple Mail (2.3445.104.21) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [136.160.90.53] 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:113004 Archived-At: --===============6657438342126600352== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DB6C6D208FD0406391C94CAFE07050CElpsumdedu_" --_000_DB6C6D208FD0406391C94CAFE07050CElpsumdedu_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hey--- I'm trying to insert outlined text (derived from MetaFun example code) into= a document and it seems to work up to the point that the text has depth (d= escenders). There's a previous post that mentions using textcommand for tit= les to ensure that the appropriate baseline is used but I haven't figured o= ut why that would work; for my purposes, I'm insert the text inline so that= solution wouldn't work here. I have included a MWE that demonstrates the p= roblem; I've tried putting both the text and the outlined text in a box, th= en adjusting the outlined text by the depth of the text itself but that doe= sn't seem to work. I expect that there's an easy way either in MP or ConTeX= t, but I haven't found it yet. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \OutlinedText[glyph][outline]{text} \def\OutlinedText{\dodoubleempty\doOutlinedText} \def\doOutlinedText[#1][#2]#3% {% % ((((\type{#1}::\type{#2}::\type{#3})))) \ifsecondargument \makeOutlinedText{#1}{#2}{#3}% \else\iffirstargument \makeOutlinedText{#1}{black}{#3}% \else \makeOutlinedText{white}{black}{#3}% \fi\fi } \def\makeOutlinedText#1#2#3% {% \startMPcode draw outlinetext.b("#3") (withcolor "#1") (withcolor "#2" withpen pencircle scaled 1/16); \stopMPcode \autoinsertnextspace } \starttext start \OutlinedText{aaa} and \OutlinedText{Bbb} and \OutlinedText{ggg} and \OutlinedText{Yyy} finish \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (Here is the code with my attemps to shift the baseline; the \dp & \wd appr= oach seems to do nothing, and the \lower doesn't compile and I haven't purs= ued why yet.) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\makeOutlinedText#1#2#3% % {% % \newbox\tBox % \newbox\uBox % \setbox\tBox\hbox{#3} % \setbox\uBox % \hbox{% % \startMPcode % draw outlinetext.b("#3") % (withcolor "#1") % (withcolor "#2" withpen pencircle scaled 1/16); % \stopMPcode % }% % % \lower\uBox\dp\tBox % \ht\uBox=3D\ht\tBox % \dp\uBox=3D\dp\tBox % \unbox\uBox % \autoinsertnextspace } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Any feedback or suggestions would be appreciated. ---K Kevin W. Rudd, Ph.D. CAPT, USN (Ret) Computer Architecture & Computer Engineering Advanced Computing Systems (ACS) Research Program Laboratory for Physical Sciences (LPS) 443-654-7878 kevin@lps.umd.edu Visiting Research Professor United States Naval Academy rudd@usna.edu --_000_DB6C6D208FD0406391C94CAFE07050CElpsumdedu_ Content-Type: text/html; charset="us-ascii" Content-ID: <686894C1B0707A41BCA8E5F4B08F5413@lps.umd.edu> Content-Transfer-Encoding: quoted-printable
Hey---

I'm trying to insert outlined text (derived from MetaFun ex= ample code) into a document and it seems to work up to the point that the t= ext has depth (descenders). There's a previous post that mentions using tex= tcommand for titles to ensure that the appropriate baseline is used but I haven't figured out why that would = work; for my purposes, I'm insert the text inline so that solution wouldn't= work here. I have included a MWE that demonstrates the problem; I've tried= putting both the text and the outlined text in a box, then adjusting the outlined text by the depth of the text i= tself but that doesn't seem to work. I expect that there's an easy way eith= er in MP or ConTeXt, but I haven't found it yet.

%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \OutlinedText[glyph][ou= tline]{text}
\def\OutlinedText{\dodoub= leempty\doOutlinedText}

\def\doOutlinedText[#1][#= 2]#3%
{%
    % ((((\type= {#1}::\type{#2}::\type{#3}))))
    \ifsecondar= gument
      &nbs= p; \makeOutlinedText{#1}{#2}{#3}%
    \else\iffir= stargument
      &nbs= p; \makeOutlinedText{#1}{black}{#3}%
    \else
      &nbs= p; \makeOutlinedText{white}{black}{#3}%
    \fi\fi
}

\def\makeOutlinedText#1#2= #3%
{%
    \startMPcod= e
    draw outlin= etext.b("#3")
      &nbs= p;  (withcolor "#1")
      &nbs= p;  (withcolor "#2" withpen pencircle scaled 1/16);
    \stopMPcode=
    \autoinsert= nextspace
}

\starttext
    start
      &nbs= p;  \OutlinedText{aaa}
    and  \= OutlinedText{Bbb}
    and  \= OutlinedText{ggg}
    and  \= OutlinedText{Yyy}
    finish
\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


(Here is the code with my attemps to shift the baseline; th= e \dp & \wd approach seems to do nothing, and the \lower doesn't compil= e and I haven't pursued why yet.)


%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \def\makeOutlinedText#1= #2#3%
% {%
%     \newbox\t= Box
%     \newbox\u= Box
%     \setbox\t= Box\hbox{#3}
%     \setbox\u= Box
%     \hbox{%
%       &n= bsp; \startMPcode
%       &n= bsp; draw outlinetext.b("#3")
%       &n= bsp;      (withcolor "#1")
%       &n= bsp;      (withcolor "#2" withpen pencircle scaled= 1/16);
%       &n= bsp; \stopMPcode
%     }%=
%     % \lower\= uBox\dp\tBox
%     \ht\uBox= =3D\ht\tBox
%     \dp\uBox= =3D\dp\tBox
%     \unbox\uB= ox
%     \autoinse= rtnextspace
}

%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Any feedback or suggestions would be appreciated.
 ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering 
Advanced Computing Systems (ACS) Research Program 
Laboratory for Physical Sciences (LPS) 

443-654-7878 
kevin@lps.umd.edu

Visiting Research Professor
United States Naval Academy

rudd@usna.edu

--_000_DB6C6D208FD0406391C94CAFE07050CElpsumdedu_-- --===============6657438342126600352== 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== --===============6657438342126600352==--