ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* some secret mp commands
@ 2000-10-16  7:39 Hans Hagen
  0 siblings, 0 replies; only message in thread
From: Hans Hagen @ 2000-10-16  7:39 UTC (permalink / raw)


Hi mp friends, 

While I was playing a bit with the graph macros that come with mpost
[actually, extending the format package] i uncovered some commands that are
not defined in the mp manual, but nevertheless quite interesting. I will
cover them in the metafun manual, but here is already an impression:

vardef inverted expr p =
  save pp ; picture pp ; pp := nullpicture ;
  for i within p :
    addto pp if stroked i : doublepath else : contour fi pathpart i
    dashed dashpart i withpen penpart i
    withcolor white-(redpart i, greenpart i, bluepart i) ;
  endfor ;
  pp
enddef ;

beginfig(1)
  colorcircle(10cm,red,green,blue) ;
  currentpicture := inverted currentpicture ;
endfig ;

So, one can disassemble a picture using a within loop and *part primitives!
Another one is truecorners but I still have to find out what it does. [i
found a few more by browsing the mp.pool file, like fontsize that reports
the real font size [so something infont "string" at size is now possible.] 

Hans  
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-10-16  7:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-16  7:39 some secret mp commands Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).