[NTG-context] question about followtext in MP

Pablo Rodriguez oinos at gmx.es
Wed May 23 18:40:14 CEST 2018


On 05/23/2018 06:05 PM, Hans Hagen wrote:
> On 5/23/2018 5:50 PM, Pablo Rodriguez wrote:
>>
>> Many thanks for your reply, Hans.
>>
>> Is there any way to set origin to another value than (0, 0) in MP?
>>
>> I realize it might sound weird, but it would make things easier in an
>> example that I’m working on.
> 
> redefining origin is a bad idea (don't expect help if you do that)
> 
> you can alway sdo
> 
> currentpicture := currentpicture shifted - center currentpicture;

Many thanks for your replies, Hans and Alan.

Geometry isn’t one of my strengths (and this is almost my first contact
with MP).

I have the following sample:

  \starttext
  \edef\TextInside{Just follow the tokens}
  \startMPpage
    path p ; p := reverse halfcircle scaled .6TextWidth;
    path q ; q := halfcircle rotatedaround (origin, 180)
        scaled (.6TextWidth + .75LineHeight);
    %~ draw fullcircle scaled .6TextWidth;
    draw followtext(p, "·\TextInside") ;
    draw followtext(q, "\TextInside·") ;
    path c ; c := (origin -- (6, 0) -- (0.5, -4) -- (3, 2) --
        (5.5, -4) -- cycle) scaled 1.25cm ;
    %~ c := c shifted (-3,-3) ;
    draw followtext(c, "\dorecurse{500}{\utfchar{"EB09}}") ;
  \stopMPpage
  \stoptext

How can I shift the path c (I mean, the one that draws a star?

I have tried to add the shifted option to the path definition and
drawing and there was no shift in the MP page.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk


More information about the ntg-context mailing list