diff options
Diffstat (limited to 'Master/texmf-dist/metapost/context/base/mp-base.mpii')
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mp-base.mpii | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/Master/texmf-dist/metapost/context/base/mp-base.mpii b/Master/texmf-dist/metapost/context/base/mp-base.mpii index 93cb5e90c8d..7af4bc436e3 100644 --- a/Master/texmf-dist/metapost/context/base/mp-base.mpii +++ b/Master/texmf-dist/metapost/context/base/mp-base.mpii @@ -1,12 +1,15 @@ % This is (currently) a copy of the plain.mp file. We use a copy % because (1) we want to make sure that there are no unresolved % dependencies, and (2) we may patch this file eventually. +% +% colorpart will be overloaded later (we already had that one) +% _findarr now has a filldraw, was fill in 0.63 % This file gives the macros for plain MetaPost % It contains all the features of plain METAFONT except those specific to % font-making. (See The METAFONTbook by D.E. Knuth). % There are also a number of macros for labeling figures, etc. -string base_name, base_version; base_name="plain"; base_version="0.63"; +string base_name, base_version; base_name="plain"; base_version="1.004 for metafun ii"; message "Preloading the plain mem file, version "&base_version; @@ -107,14 +110,37 @@ transform identity; for z=origin,right,up: z transformed identity = z; endfor % color constants -color black, white, red, green, blue, background; +color black, white, red, green, blue, cyan, magenta, yellow, background; black = (0,0,0); white = (1,1,1); red = (1,0,0); green = (0,1,0); blue = (0,0,1); +cyan = (0,1,1); +magenta = (1,0,1); +yellow = (1,1,0); background = white; % The user can reset this +% color part selection for within +def colorpart primary t = + if colormodel t=7: + (cyanpart t, magentapart t, yellowpart t, blackpart t) + elseif colormodel t=5: + (redpart t, greenpart t, bluepart t) + elseif colormodel t=3: + (greypart t) + elseif colormodel t=1: + false + else: + %%% For clipping and bounding paths, etc. + if defaultcolormodel=7: (0,0,0,1) + elseif defaultcolormodel=5: black + elseif defaultcolormodel=3: 0 + else: false + fi + fi +enddef; + % picture constants picture blankpicture,evenly,withdots; blankpicture=nullpicture; % `display blankpicture...' @@ -337,9 +363,17 @@ enddef; def filldraw expr c = addto currentpicture contour c withpen currentpen _op_ enddef; -def drawdot expr z = - addto currentpicture contour makepath currentpen shifted z - _op_ enddef; +% def drawdot expr z = +% addto currentpicture contour makepath currentpen shifted z +% _op_ enddef; + +def drawdot expr p = + if pair p : + addto currentpicture doublepath p withpen currentpen _op_ + else : + errmessage("drawdot only accepts a pair expression") + fi +enddef ; def unfill expr c = fill c withcolor background enddef; def undraw expr p = draw p withcolor background enddef; @@ -441,8 +475,8 @@ enddef; def _findarr text t = draw _apth t; - fill arrowhead _apth withpen currentpen t; - fill arrowhead reverse _apth withpen currentpen t + filldraw arrowhead _apth withpen currentpen t; + filldraw arrowhead reverse _apth withpen currentpen t enddef; @@ -479,7 +513,6 @@ def label = draw thelabel enddef; newinternal dotlabeldiam; dotlabeldiam:=3bp; vardef dotlabel@#(expr s,z) text t_ = label@#(s,z) t_; -% label@#(s,z); interim linecap:=rounded; draw z withpen pencircle scaled dotlabeldiam t_; enddef; |