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=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, g=0.000,
b=0.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’t 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=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, g=0.000,
b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm [My]\\Application\\(Component)\par }}

Thank you, that works: 


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:=33.000; y:=53.000; w:=133.000; h:=53.000;pic := 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=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm [My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw pic;path AllNodeIds_idIC;  AllNodeIds_idIC := pathpart pic; pair AllNodeCenters_idIC; AllNodeCenters_idIC := 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=flushright,frame=on,offset=none,width=106.400bp]{\colored [r=0.000, g=0.000, b=0.000]{\switchtobodyfont [11.0pt]\setupinterlinespace [11.5pt] \rm [My]\\Application\\(Component)}}}

The result of which is


Minimal example:

\enabletrackers[context.trace]
\starttext

% Works OK:
\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, g=0.000,
b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm [My]\\Application\\(Component)\par}}

% Doesn’t work:
\startMPpage[instance=doublefun]
draw textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm [My]\\Application\\(Component)\par}}\par");
\stopMPpage


\stoptext

So, now I’m looking for a way to prevent textext() to eat my \pars

G