Re: [NTG-context] MetaFun - "remove the paths of text" from a rectangle to let the background visible

2020-12-23 Thread Hans Hagen
l outlines = document.outlinepaths(char)     local nofpaths = #outlines     context("\\startMPdrawing") -- ADDED by garulfo     context("path %s[] ;",target)     context("numeric %sn ; %sn := %s ;",target,target,nofpaths)     for i=1,

Re: [NTG-context] MetaFun - "remove the paths of text" from a rectangle to let the background visible

2020-12-23 Thread Otared Kavian
then >local units = shapedata.units or 1000 >local factor = 100/units >return fonts.metapost.paths(glyph,factor) >end >end > return { } > end > > function document.defineoutline(char,target) >local outlines = document.

Re: [NTG-context] MetaFun - "remove the paths of text" from a rectangle to let the background visible

2020-12-23 Thread Garulfo
rn { } end function document.defineoutline(char,target) local outlines = document.outlinepaths(char) local nofpaths = #outlines context("\\startMPdrawing") -- ADDED by garulfo context("path %s[] ;",target) context("nume

Re: [NTG-context] Circled text in metapost

2018-03-30 Thread Henri Menke
kfile{meta-imp-txt} is the wrong way.  It's supposed to be \useMPlibrary[txt] > \starttext > > \startuseMPgraphic{followtokens} >   path RotPath ; RotPath := reverse halfcircle ; > \stopuseMPgraphic > \followtokens{Text on a half circle} > > \stoptext > > > >

Re: [NTG-context] Circled text in metapost

2018-03-30 Thread Henri Menke
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 ; > \st

Re: [NTG-context] Circled text in metapost

2018-03-29 Thread Gerhard Kugler
Take a look at the Metafun manual. > In the manual is an example on page 233 with the following content: - \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

Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-14 Thread Marco Patzer
%% {\vbox\bgroup \forgetall \dontcomplain \startMPenvironment \doifundefined{RotFont}{\definefont[RotFont][RegularBold]} \stopMPenvironment \MPtoks\emptytoks \resetMPdrawing \startMPdrawing \includeMPgraphic{followtokenscentred} ; picture pic[] ; numeric len[], n ; n

[NTG-context] Problem with \useMPlibrary[txt]

2012-09-17 Thread pol stra
toegevoegd 156 {\appendtoks#1\to\MPtoks 157\setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}% 158\startMPdrawing 159 n := n + 1 ; len[n] := \the\wd\MPbox ; argument \??sh \setsomevalue #1#2-\expandafter \def \csname #1

Re: [NTG-context] Setting style and color attributes of label in metapost

2011-10-13 Thread Wolfgang Schuster
[test] [style=yes, name=test, command=yes, setup=yes] \definetest [blue] [color=blue, text=Blue] \definetest [two] [blue] [style=\bold, text=Two] \starttext \edef\currenttest{two} \startMPdrawing label.lft(\sometxt{\dosettestattributes{style}{color

[NTG-context] Setting style and color attributes of label in metapost

2011-09-24 Thread Aditya Mahajan
, setup=yes] \definetest [blue] [color=blue, text=Blue] \definetest [two] [blue] [style=\bold, text=Two] \starttext \edef\currenttest{two} \startMPdrawing label.lft(\sometxt{\dosettestattributes{style}{color} \testparameter{text}}, (0,0)) ; \stopMPdrawing \edef\currenttest{blue

Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-20 Thread Verhaag, G.C.H.M.
as: \resetMPdrawing \startMPdrawing picture pic[] ; numeric wid[], len[], pos[], n ; wid[0] := len[0] := pos[0] := n := 0 ; \stopMPdrawing \def\whatever#1% {\appendtoks#1\to\MPtoks \setbox\MPbox=\hbox{\bfd\the\MPtoks}% \startMPdrawing n := n + 1 ; len[n] := \the\wd\MPbox ; \stopMPdrawing \startMPdrawing[-] pic[n

Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-20 Thread luigi scarso
You can also use mkii as command line drawing tool: # mtxrun texexec test.tex \starttext \startTEXpage \resetMPdrawing \startMPdrawing picture pic[] ; numeric wid[], len[], pos[], n ; wid[0] := len[0] := pos[0] := n := 0 ; \stopMPdrawing \def\whatever#1% {\appendtoks#1\to\MPtoks \setbox\MPbox

Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-19 Thread Verhaag, G.C.H.M.
Verhaag, G.C.H.M. wrote: Hi, I wanted to try (using ConTeXt minimals MkIV) the example on page 228 of the MetaFun manual, dealing with typesetting in MetaPost. The code is given as: \resetMPdrawing \startMPdrawing picture pic[] ; numeric wid[], len[], pos[], n ; wid[0] := len[0] := pos[0

Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-19 Thread Peter Rolf
Am 19.01.2011 14:35, schrieb Verhaag, G.C.H.M.: Verhaag, G.C.H.M. wrote: Hi, I wanted to try (using ConTeXt minimals MkIV) the example on page 228 of the MetaFun manual, dealing with typesetting in MetaPost. The code is given as: \resetMPdrawing \startMPdrawing picture pic

Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-19 Thread Aditya Mahajan
On Tue, 18 Jan 2011, Verhaag, G.C.H.M. wrote: Hi, I wanted to try (using ConTeXt minimals MkIV) the example on page 228 of the MetaFun manual, dealing with typesetting in MetaPost. I haven't look at the metapost manual ... but The code is given as: \resetMPdrawing \startMPdrawing picture

[NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-18 Thread Verhaag, G.C.H.M.
Hi, I wanted to try (using ConTeXt minimals MkIV) the example on page 228 of the MetaFun manual, dealing with typesetting in MetaPost. The code is given as: \resetMPdrawing \startMPdrawing picture pic[] ; numeric wid[], len[], pos[], n ; wid[0] := len[0] := pos[0] := n := 0 ; \stopMPdrawing

Re: [NTG-context] ppchtex color

2009-05-12 Thread Hans Hagen
\chemicalattributes {withpen pencircle scaled \the\scratchdimen\space withcolor }% \doifelsenothing\@@chemicalrulecolor {\edef\chemicalattributes{\chemicalattributes black}} {\edef\chemicalattributes{\chemicalattributes \MPcolor{\@@chemicalrulecolor}}}% \startMPdrawing drawoptions

Re: [NTG-context] Colored labels with MetaPost in MkII

2008-10-29 Thread Wolfgang Schuster
\sometxt in MKII and MKIV (which I need to summarize on the wiki). Here is a new example where I can't even use \sometxt. Sometxt does not work appear to work with \startMPdrawing (there is no output at all). I think that the reason is that MPdrawing simply writes stuff to the MPfile

Re: [NTG-context] Colored labels with MetaPost in MkII

2008-10-28 Thread Aditya Mahajan
). Here is a new example where I can't even use \sometxt. Sometxt does not work appear to work with \startMPdrawing (there is no output at all). I think that the reason is that MPdrawing simply writes stuff to the MPfile without doing the extra work needed for sometxt. I will call this is a bug

Re: [NTG-context] Colored labels with MetaPost in MkII

2008-10-27 Thread Wolfgang Schuster
. \setupcolors[state=start] \def\labelstyle{bold} \def\labelcolor{red} \starttext \resetMPdrawing \startMPdrawing label(textext(\doattributes{label}{style}{color}{Label}),origin) ; label(\sometxt{\doattributes{label}{style}{color}{Label}},origin) ; \stopMPdrawing \MPdrawingdonetrue \getMPdrawing

[NTG-context] Weird Fieldstack problem

2007-06-08 Thread Zhichu Chen
Hi, I've written the following test file: == \setupcolors[state=start] \setuppagenumbering[state=stop] \setupinteraction [state=start] \starttext \MPdrawingdonetrue \startMPdrawing draw (0,0)--(2cm,2cm); \stopMPdrawing \definesymbol[aa][\getMPdrawing] \startMPdrawing

Re: [NTG-context] Weird Fieldstack problem

2007-06-08 Thread Aditya Mahajan
On Fri, 8 Jun 2007, Zhichu Chen wrote: Hi, I've written the following test file: == \setupcolors[state=start] \setuppagenumbering[state=stop] \setupinteraction [state=start] \starttext \MPdrawingdonetrue \startMPdrawing draw (0,0)--(2cm,2cm); \stopMPdrawing

Re: [NTG-context] Weird Fieldstack problem

2007-06-08 Thread Zhichu Chen
\MPdrawingdonetrue \startMPdrawing draw (0,0)--(2cm,2cm); \stopMPdrawing \definesymbol[aa][\getMPdrawing] \startMPdrawing draw (2cm,2cm)--(2cm,0); \stopMPdrawing \definesymbol[bb][\getMPdrawing] \startMPdrawing draw (0,0)--(2cm,0); \stopMPdrawing \definesymbol[cc][\getMPdrawing

Re: [NTG-context] followtokens font color

2006-01-08 Thread Renaud AUBIN
}{\definefont[RotFont][RegularBold]} \stopMPenvironment \MPtoks\emptytoks \resetMPdrawing \startMPdrawing \includeMPgraphic{followtokens} picture pic[] ; numeric len[], n ; n := 0 ; \stopMPdrawing \handletokens#1\with\processfollowingtoken \startMPdrawing if unknown RotPath : path