Re: [NTG-context] using a red frame as an overlay

2021-08-02 Thread Hans Hagen via ntg-context

On 8/2/2021 1:38 PM, Jeong Dal via ntg-context wrote:

Hi,

I used red frame which is in the metafun manual for long time.
But it is not working now.
Here is a MWE and a part of the log file.
What should I change in the definitions?


just update

I am using "ConTeXt  ver: 2021.07.10 21:51 LMTX  fmt: 2021.7.12  int: 
english/english”.

(some argument issue already resolved as side effect of stacking support)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] using a red frame as an overlay

2021-08-02 Thread Jeong Dal via ntg-context
Hi,

I used red frame which is in the metafun manual for long time.
But it is not working now. 
Here is a MWE and a part of the log file.
What should I change in the definitions?

I am using "ConTeXt  ver: 2021.07.10 21:51 LMTX  fmt: 2021.7.12  int: 
english/english”.

 framed Text with title %%%
\startuseMPgraphic{redFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FrameText}) ;
o := BodyFontSize ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
%fill b withcolor .85white ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;  %.425green;%.
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic

\defineoverlay[rFrame][\useMPgraphic{redFrame}]

\defineframedtext[rfText]
[frame=off,
background=rFrame,
offset=\bodyfontsize,
width=\textwidth,
before=\blank,
after=\blank]

\def\StartFrame{\blank\startrfText}
\def\StopFrame {\stoprfText\blank}

\starttext

\StartFrame
This is a test for the frame. 
This is a test for the frame. 
This is a test for the frame. 
This is a test for the frame. 
This is a test for the frame. 
This is a test for the frame. 
\StopFrame
\stoptext

\starttext


log file:

fonts   > 'fallback modern-designsize rm 12pt' is loaded
tex error   > tex error on line 41 in file /Users/graph/Library/Mobile 
Documents/com~apple~CloudDocs/texMain/test.tex: Use of \meta_usempgraphic_nop 
doesn't match its definition

 
}
 \executedefinedoverlay #1#2->\bgroup \setlayoutcomponentattribute 
{\v!overlay :#1}\setbox \scratchbox \hbox \layoutcomponentboxattribute {\the 
\everyoverlay #2}
\boxxoffset \scratchbox -.5\dimexpr \wd \scratchbox -\d_framed_target_wd 
\relax \boxyoffset \scratchbox -.5\dimex
 \pack_framed_process_background_indeed_internal #1->\bgroup \setbox 
\b_framed_extra \hpack \bgroup \ifzeropt \framedbackgroundoffset \else \kern 
-\framedbackgroundoffset \fi \hbox \bgroup #1
\egroup \egroup \wd \b_framed_extra \zeropoint \ht \b_framed_extra 
\framedbackgroundheight \dp \b_framed_ext

 \m_framed_background ...background \endcsname \expandafter 
\pack_framed_process_background_indeed_internal \lastnamedcs \orelse \ifcsname 
\??overlay \m_framed_background \endcsname \expandafter 
\pack_framed_process_background_indeed_external \lastnamedcs 
\fi 

 \pack_framed_process_backgrounds #1,#2->\edef \m_framed_background 
{#1}\ifx \m_framed_background \s!unknown \else \pack_framed_process_background 
\expandafter \pack_framed_process_backgrounds \fi #2

 \p_framed_component ...s\let \foregroundbox 
\pack_framed_background_box_content \hpack \layoutcomponentboxattribute to 
\framedbackgroundwidth \bgroup \the \everybackgroundbox \expandafter 
\pack_framed_process_backgrounds \p_framed_background ,\s!unknown 
,\relax \box ...
...


 \StopFrame

31 
32 \starttext
33 
34 \StartFrame
35 This is a test for the frame. 
36 This is a test for the frame. 
37 This is a test for the frame. 
38 This is a test for the frame. 
39 This is a test for the frame. 
40 This is a test for the frame. 
41 >>  \StopFrame
42 
43 \stoptext
44 
If you say, e.g., '\def\a1{...}', then you must always put '1' after '\a',
since control sequence names are made up of letters only. The macro here has not
been followed by the required stuff, so I'm ignoring it.
mtx-context | fatal error: return code: 256___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___