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,
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.
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
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
>
>
> >
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
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
%%
{\vbox\bgroup
\forgetall
\dontcomplain
\startMPenvironment
\doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
\stopMPenvironment
\MPtoks\emptytoks
\resetMPdrawing
\startMPdrawing
\includeMPgraphic{followtokenscentred} ;
picture pic[] ; numeric len[], n ; n
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
[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
,
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
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
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
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
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
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
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
\chemicalattributes
{withpen pencircle scaled \the\scratchdimen\space
withcolor }%
\doifelsenothing\@@chemicalrulecolor
{\edef\chemicalattributes{\chemicalattributes black}}
{\edef\chemicalattributes{\chemicalattributes
\MPcolor{\@@chemicalrulecolor}}}%
\startMPdrawing
drawoptions
\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
).
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
.
\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
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
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
\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
}{\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
24 matches
Mail list logo