On 10/13/2013 9:59 AM, Magnus J wrote:
Hello list,

How can I call the \followtokens macro (or a similar solution) from
within metapost?  Specifically, I want to integrate text between the
semi-circle arcs in a rainbow-like structure (with the text placed
inbetween the arcs, that should alsó be drawn). The text should not be
stretched but center on the top, flowing evenly distributed on each
side. This link will give you an idea:

http://www.heilsuefling.is/heilsuefling/upload/images/whp_in_general/determinants_of_health/determinants_of_health.jpg

How can this achieved?

a bit clumsy but workable

\starttext

\useMPlibrary[txt]

\startsetups text-a
    \startuseMPgraphic{followtokens}
        path RotPath ; RotPath := reverse halfcircle xyscaled 5cm ;
        draw RotPath ;
    \stopuseMPgraphic
    \followtokens{some text but not that long{\hskip1em}}
\stopsetups

\startsetups text-b
    \startuseMPgraphic{followtokens}
        path RotPath ; RotPath := reverse halfcircle xyscaled 3cm  ;
        draw RotPath ;
    \stopuseMPgraphic
    \followtokens{{\hskip1em}some text{\hskip1em}}
\stopsetups

\startMPpage
    draw textext("\setups{text-a}") ;
    draw textext("\setups{text-b}") shifted (0,-.5cm);
\stopMPpage

\stoptext



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to