ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jeong Dal via ntg-context <ntg-context@ntg.nl>
To: "list ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl
	ntg-context@ntg.nl" <ntg-context@ntg.nl>
Cc: Jeong Dal <haksan@me.com>
Subject: using a red frame as an overlay
Date: Mon, 2 Aug 2021 20:38:43 +0900	[thread overview]
Message-ID: <AE5C8767-4427-4AF1-9B9B-3FD3A792EA29@me.com> (raw)
In-Reply-To: <mailman.1152.1627839213.1143.ntg-context@ntg.nl>


[-- Attachment #1.1: Type: text/plain, Size: 3717 bytes --]

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

<to be read again> 
    }
<macro> \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
<macro> \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

<macro> \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 

<macro> \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

<macro> \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 ...
...


<line 4.41> \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

[-- Attachment #1.2: Type: text/html, Size: 11615 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

       reply	other threads:[~2021-08-02 11:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1152.1627839213.1143.ntg-context@ntg.nl>
2021-08-02 11:38 ` Jeong Dal via ntg-context [this message]
2021-08-02 15:32   ` Hans Hagen via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AE5C8767-4427-4AF1-9B9B-3FD3A792EA29@me.com \
    --to=ntg-context@ntg.nl \
    --cc=haksan@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).