From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/107055 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=] Date: Sat, 25 Apr 2020 00:51:12 +0200 Message-ID: <201DB5F7-B38B-4591-99E8-762CCA4CB769@rna.nl> References: <72F4A8CC-2FBD-4C16-8607-F90EDE5A621D@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="===============7608555732149671970==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="47644"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Apr 25 00:53:33 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 1jS7CO-000CGR-UQ for gctc-ntg-context-518@m.gmane-mx.org; Sat, 25 Apr 2020 00:53:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C2F951836FC; Sat, 25 Apr 2020 00:51:16 +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 7sgZk-fxmyv5; Sat, 25 Apr 2020 00:51:14 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A1CED1836AD; Sat, 25 Apr 2020 00:51:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4012E183697 for ; Sat, 25 Apr 2020 00:51:14 +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 e_4Ex0z4x4s7 for ; Sat, 25 Apr 2020 00:51:13 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (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 808621836F9 for ; Sat, 25 Apr 2020 00:51:13 +0200 (CEST) Original-Received: from hermione.rna.nl (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id D8C113DB2BA0 for ; Sat, 25 Apr 2020 00:51:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1587768672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: references:references; bh=EdjBmgzZMC0nBTWHqZcijXHyPDY5ArrdgQM1VN2jQ9c=; b=Qo2ROIOHAj50Iv55M/DwxmvGdVBurvpmg8QhB/TqLtkNBqEINRpgcpbtILb8QBLQkGreGs LWd5O/UoPt0cE/NzmH8ZVhj0SDf2sJwQaqaCf6w5yprUxPR8+4BbbILn2LPCSB0yXHDEtJ nZhhIFi+cJv8YhsKKt3wZsC/AdHsfbO8hgPz+fONM/4oEhp0ZfH54hLTZl4L6P82ZNpWi0 qC94ZfFvusgkFLBa8V1CH9TiuF3KZ8n3bs4LHKQ7hoyu3+sJA0i3gMVsq43GUXB9zK/RCu BI7JaAmAFelWykbatJ911zRrkfi+mHKRJRVdMDQId4igLfNPyd6y1rSUY+aWMQ== X-Mailer: Apple Mail (2.3445.104.14) 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:107055 Archived-At: --===============7608555732149671970== Content-Type: multipart/alternative; boundary="Apple-Mail=_F0F3328A-0DBA-4C9E-AC98-0D260561D611" --Apple-Mail=_F0F3328A-0DBA-4C9E-AC98-0D260561D611 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 24 Apr 2020, at 18:40, Thomas A. Schmitz = > wrote: >=20 >=20 >=20 >> On 24. Apr 2020, at 18:19, Gerben Wierda > wrote: >>=20 >> \starttext >>=20 >> = \framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.400bp]{\co= lored[r=3D0.000, g=3D0.000, >> b=3D0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm = [My]\\Application\\(Component)}} >>=20 >> \stoptext >>=20 >> and if I change the value to 0.6, only the first line break gets = packed somewhat. But I can=E2=80=99t get the entire paragraph inside the = frame packed. I played around with the placing of setupinterlinespace in = that snippet above, but nothing really works so far. >>=20 >=20 > At the end of your frame, you need an explicit \par to make the change = of linespacing work: >=20 > = \framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.400bp]{\co= lored[r=3D0.000, g=3D0.000, > b=3D0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm = [My]\\Application\\(Component)\par }} Thank you, that works. (Can=E2=80=99t put in the images to show, as this = gets my message over 100k) But it turns out, I have an additional problem because I am doing this = inside a textext() from METAPOST and that seems to strip the \pars = again. Tracking ConTeXt: cld > tex > f : 8 : picture pic; x:=3D33.000; y:=3D53.000; = w:=3D133.000; h:=3D53.000;pic :=3D ApplicationComponentLogo( w, h, = (0.686,1.000,1.000), 0.200, 1.000, (0.000,0.000,0.000), 1.000, 0.700, = (0.000,0.000,0.000), 1.000, = "\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.400bp]{\c= olored[r=3D0.000, g=3D0.000, = b=3D0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm = [My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw = pic;path AllNodeIds_idIC; AllNodeIds_idIC :=3D pathpart pic; pair = AllNodeCenters_idIC; AllNodeCenters_idIC :=3D center pic; which looks OK (this is lmtx passing the string to ConTeXt using the lua = context() call). The \pars are still there. Then later, when METAPOST is at it and that same string is used to put = into textext(), it results in: cld > tex > w : - : \MPLIBsetNtextX{3}{\framed = [align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.400bp]{\colored = [r=3D0.000, g=3D0.000, b=3D0.000]{\switchtobodyfont = [11.0pt]\setupinterlinespace [11.5pt] \rm = [My]\\Application\\(Component)}}} Minimal example: \enabletrackers[context.trace] \starttext % Works OK: = \framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.400bp]{\co= lored[r=3D0.000, g=3D0.000, b=3D0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm = [My]\\Application\\(Component)\par}} % Doesn=E2=80=99t work: \startMPpage[instance=3Ddoublefun] draw = textext("\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.4= 00bp]{\colored[r=3D0.000, g=3D0.000, = b=3D0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm = [My]\\Application\\(Component)\par}}\par"); \stopMPpage \stoptext So, now I=E2=80=99m looking for a way to prevent textext() to eat my = \pars G --Apple-Mail=_F0F3328A-0DBA-4C9E-AC98-0D260561D611 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 24 Apr 2020, at 18:40, Thomas A. Schmitz <thomas.schmitz@uni-bonn.de> wrote:



On 24. = Apr 2020, at 18:19, Gerben Wierda <gerben.wierda@rna.nl> wrote:

\starttext

\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106= .400bp]{\colored[r=3D0.000, g=3D0.000,
b=3D0.000]{\switchtobodyfont[11.0pt] = \setupinterlinespace[20pt] \rm [My]\\Application\\(Component)}}

\stoptext

and if = I change the value to 0.6, only the first line break gets packed = somewhat. But I can=E2=80=99t get the entire paragraph inside the frame = packed. I played around with the placing of setupinterlinespace in that = snippet above, but nothing really works so far.


At the end of your frame, you = need an explicit \par to make the change of linespacing work:

\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106= .400bp]{\colored[r=3D0.000, g=3D0.000,
b=3D0.000]{\switchtobodyfont[11.0pt] = \setupinterlinespace[14pt] \rm [My]\\Application\\(Component)\par }}

Thank you, that works. (Can=E2=80=99t = put in the images to show, as this gets my message over 100k)

But it turns out, I have = an additional problem because I am doing this inside a textext() from = METAPOST and that seems to strip the \pars again. Tracking = ConTeXt:

cld       =       > tex > f : 8 : picture pic; x:=3D33.000; = y:=3D53.000; w:=3D133.000; h:=3D53.000;pic :=3D = ApplicationComponentLogo( w, h, (0.686,1.000,1.000), 0.200, 1.000, = (0.000,0.000,0.000), 1.000, 0.700, (0.000,0.000,0.000), 1.000, "\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D10= 6.400bp]{\colored[r=3D0.000, g=3D0.000, = b=3D0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm = [My]\\Application\\(Component)\par}}\par") shifted (x, = -y); draw pic;path AllNodeIds_idIC;  AllNodeIds_idIC :=3D pathpart = pic; pair AllNodeCenters_idIC; AllNodeCenters_idIC :=3D center = pic;

which looks OK (this is = lmtx passing the string to ConTeXt using the lua context() call). The = \pars are still there.

Then later, when METAPOST is at it and that same string is = used to put into textext(), it results in:

cld           =   > tex > w : - : \MPLIBsetNtextX{3}{\framed = [align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.400bp]{\colored = [r=3D0.000, g=3D0.000, b=3D0.000]{\switchtobodyfont = [11.0pt]\setupinterlinespace [11.5pt] \rm = [My]\\Application\\(Component)}}}


Minimal example:

\enabletrackers[context.trace]
\starttext

% Works OK:
\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106= .400bp]{\colored[r=3D0.000, g=3D0.000,
b=3D0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt= ] \rm [My]\\Application\\(Component)\par}}

% Doesn=E2=80=99t = work:
\startMPpage[instance=3Ddoublefun]
draw = textext("\framed[align=3Dflushright,frame=3Don,offset=3Dnone,width=3D106.4= 00bp]{\colored[r=3D0.000, g=3D0.000, = b=3D0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm = [My]\\Application\\(Component)\par}}\par");
\stopMPpage


\stoptext

So, now I=E2=80=99m looking for a = way to prevent textext() to eat my \pars

G

= --Apple-Mail=_F0F3328A-0DBA-4C9E-AC98-0D260561D611-- --===============7608555732149671970== 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== --===============7608555732149671970==--