Re: [NTG-context] Calling \followtokens from with in metapost
Thanks for the code, the stretching is ok (can be hand-tuned) but I find the positioning a bit odd. Look at the additions to your example: ------------------ \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); % equal to RotPath in text-b path RotPath ; RotPath := reverse halfcircle xyscaled 3cm ; draw RotPath shifted (0,-.5cm) withcolor red ; % vertically aligned (by trial and error), but not horizontally) draw RotPath shifted (0,-1.5cm) withcolor blue ; \stopMPpage ------------------ I guess the red arc needs to be shifted further down since is has no text, but what about the horizontal alignment (as shown in blue)? If you look closely, the two spacing is different even between the black arcs on left and right sides. Regards, Magnus On 2013-10-13 Hans Hagen wrote:
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/determi...
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
participants (1)
-
Magnus J