withproperties is an experimental, metafun extension that appears to
cover color and pre/postscripts. It could be extended to cover withpen,
etc.
Look at mp-mplib.mkiv. properties() returns an image object that can
hold many things. The graph package does similar tricks.
Alan
On Sun, 23 Jul 2017 19:40:03 -0400 (EDT)
Aditya Mahajan
Hi,
Is it possible to set pen width using properties(...)? The following does not work (the color is set, but not the pen width):
\starttext \startMPcode property p[] ; p[1] := properties(withcolor red withpen pencircle scaled 1bp); p[2] := properties(withcolor blue withpen pencircle scaled 10bp);
draw fullcircle scaled 1cm withproperties p[1]; draw fullcircle scaled 2cm withproperties p[2]; \stopMPcode \stoptext
Also, what is the advantage of using properties over a simple def? (except that I cannot def a suffixed variable). For example:
\starttext \startMPcode def qA = withcolor red withpen pencircle scaled 1bp enddef; def qB = withcolor blue withpen pencircle scaled 10bp enddef;
draw fullcircle scaled 1cm qA; draw fullcircle scaled 2cm qB;
\stopMPcode \stoptext
Thanks, Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________