ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Cc: roegel@lorraine.loria.fr
Subject: TraceRot?
Date: Thu, 2 Nov 2000 02:46:08 +0100 (MET)	[thread overview]
Message-ID: <200011020146.CAA03786@bar.loria.fr> (raw)

Where should TraceRot be specified in the \followtokens
example of the metafun manual? It doesn't seem to work for me.
Also, what is the difference between \startMPenvironment
and \startMPinclusions ?

Thanks,

Denis

Example where TraceRot has no effect (and why is the type of TraceRot
declared here?):

\setupcolors[state=start]
\starttext

\startMPenvironment
%\setupbodyfont[loc,mt,ppl,pcr,10pt]
\setupbodyfont[loc,mt,10pt]
\definefont[RotFont][RegularBold]
\stopMPenvironment

\startuseMPgraphic{followtokens}
  path RotPath; RotPath:=fullcircle scaled 5cm;
\stopuseMPgraphic

\startMPinclusions
  boolean TraceRot; TraceRot := true;
\stopMPinclusions

\def\processfollowingtoken#1%
  {\appendtoks#1\to\MPtoks
   \setbox\MPbox=\hbox{\bfd\setstrut\strut\the\MPtoks}%
   \startMPdrawing
     n:=n+1; len[n]:=\the\wd\MPbox;
   \stopMPdrawing
   \startMPdrawing[-]
     pic[n]:=btex \bfd\setstrut\strut#1 etex;
   \stopMPdrawing}

\def\followtokens#1%
  {\vbox\bgroup
   \MPtoks\emptytoks
   \resetMPdrawing
   \startMPdrawing
     \includeMPgraphic{followtokens}
     picture pic[];  numeric len[],n;n:=0;
    \stopMPdrawing
    \handletokens#1\with\processfollowingtoken
    \startMPdrawing
      numeric al,pl,at,wid,pos; pair ap,ad;
      al:=arclength RotPath;
      pl:=(al-len[n])/(n-1);
      for i=1 upto n:
        wid:=abs(xpart lrcorner pic[i]-xpart llcorner pic[i]);
        pos := len[i]-wid/2+(i-1)*pl;
        at := arctime pos of RotPath;
        ap := point at of RotPath;
        ad := direction at of RotPath;
        draw pic[i]
          shifted (-wid/2,0)
          rotated (angle(ad)) shifted ap;
      endfor;
    \stopMPdrawing
    \MPdrawingdonetrue
    \getMPdrawing
    \resetMPdrawing
    \egroup} 

\followtokens{We now follow some arbitrary path ...}

\stoptext

-------


             reply	other threads:[~2000-11-02  1:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-02  1:46 Denis B. Roegel [this message]
2000-11-02 10:22 ` TraceRot? Hans Hagen
2000-11-02 12:32 TraceRot? Denis B. Roegel
2000-11-02 13:12 ` TraceRot? Hans Hagen
2000-11-03 15:25   ` TraceRot? Denis B. Roegel

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=200011020146.CAA03786@bar.loria.fr \
    --to=denis.roegel@loria.fr \
    --cc=roegel@lorraine.loria.fr \
    /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).