ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henri Menke <henrimenke@gmail.com>
To: ntg-context@ntg.nl
Subject: Re: Circled text in metapost
Date: Sat, 31 Mar 2018 12:22:32 +1300	[thread overview]
Message-ID: <1522452152.2021.75.camel@gmail.com> (raw)
In-Reply-To: <20180329160530.GI1810@pi-top>

On Thu, 2018-03-29 at 18:05 +0200, Gerhard Kugler wrote:
> On Thu, Mar 29, 2018 at 07:11:50AM -0600, Alan Braslau wrote:
> > 
> > On Thu, 29 Mar 2018 12:43:56 +0200
> > Gerhard Kugler <G.W.Kugler@posteo.de> wrote:
> > 
> > > 
> > > One misunderstanding made by my post: I want to write the text curved
> > > as a (half-)circle.
> > Take a look at the Metafun manual.
> > 
> In the manual is an example on page 233 with the following content:

Nah!  Don't use those macros.  They are only for demonstration.  Use the builtin
\followtokens instead:


\loadmarkfile{meta-imp-txt} % is this supposed to be loaded like that?
\starttext

\startuseMPgraphic{followtokens}
  path RotPath ; RotPath := reverse halfcircle ;
\stopuseMPgraphic
\followtokens{Text on a half circle}

\stoptext


> 
> -----
> 
> \def\rotatetokens#1#2#3#4% delta extra radius tokens
> {\vbox\bgroup
> \MPtoks\emptytoks
> \resetMPdrawing
> \startMPdrawing
> picture pic[] ;
> numeric wid, len[], rot ;
> numeric delta, extra, radius, n, r ;
> len[0] := n := 0 ;
> delta := #1 ; extra := #2 ; radius := #3 ;
> \stopMPdrawing
> \handletokens#4\with\processrotationtoken
> \startMPdrawing
> r := len[n]/Pi ;
> for i=1 upto n :
> wid := abs(xpart lrcorner pic[i] -
> xpart llcorner pic[i]) ;
> rot := extra + delta -
> ((len[i]-.5wid)/len[n]) * (180+2delta) ;
> draw pic[i]
> rotatedaround (origin,-270) shifted (-r-radius,
> ypart -.5[ulcorner pic[i], llcorner pic[i]])
> rotatedaround (origin,rot) ;
> endfor ;
> \stopMPdrawing
> \MPdrawingdonetrue
> \getMPdrawing
> \resetMPdrawing
> \egroup}
> 
> \startcombination[3*1]
> {\rotatetokens {0} {0}{0}{Does it work ok?}} {A}
> {\rotatetokens{20} {0}{0}{Does it work ok?}} {B}
> {\rotatetokens{20}{30}{0}{Does it work ok?}} {C}
> \stopcombination
> 
> -----
> 
> But I cannot see what part calls what parts and how they can be
> embedded.
> 
> Gerhard
> 
> 
___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2018-03-30 23:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29  9:28 Gerhard Kugler
2018-03-29  9:52 ` Henri Menke
2018-03-29 10:17   ` Hans Hagen
2018-03-29 10:43     ` Gerhard Kugler
2018-03-29 13:11       ` Alan Braslau
2018-03-29 16:05         ` Gerhard Kugler
2018-03-30 11:31           ` Gerhard Kugler
2018-03-30 14:44             ` Alan Braslau
2018-03-30 15:51               ` Gerhard Kugler
2018-03-30 23:22           ` Henri Menke [this message]
2018-03-30 23:25             ` Henri Menke
2018-03-31 17:22               ` Gerhard Kugler
2018-04-02 13:16                 ` Hans Hagen
2018-04-02 14:51                   ` Alan Braslau
2018-04-02 15:52                   ` Gerhard Kugler
2018-04-02 16:08                     ` Hans Hagen
2018-04-02 16:34                       ` Gerhard Kugler
2018-04-02 17:21                         ` Gerhard Kugler
2018-04-02 17:30                           ` Alan Braslau
2018-04-02 17:48                             ` Gerhard Kugler
2018-04-05  5:32                               ` Gerhard Kugler

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=1522452152.2021.75.camel@gmail.com \
    --to=henrimenke@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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).