summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-13 11:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-13 11:15:05 +0100
commita72850024a910d5f83e76d26137403666b3c7902 (patch)
treeeb67e742a1e699630d0f886d72a437192308743f /metapost
parentef78ab8a5c18ea5f94f4e271e8e5f5416708f7a9 (diff)
downloadcontext-a72850024a910d5f83e76d26137403666b3c7902.tar.gz
2015-01-13 11:02:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-base.mpiv11
-rw-r--r--metapost/context/base/mp-mlib.mpiv4
-rw-r--r--metapost/context/base/mp-tool.mpiv42
3 files changed, 35 insertions, 22 deletions
diff --git a/metapost/context/base/mp-base.mpiv b/metapost/context/base/mp-base.mpiv
index 94379050b..20f62d6bf 100644
--- a/metapost/context/base/mp-base.mpiv
+++ b/metapost/context/base/mp-base.mpiv
@@ -195,7 +195,8 @@ yellow := (1,1,0) ;
background := white ; % obsolete
let graypart = greypart ;
-let graycolor = greycolor ;
+let greycolor = numeric ;
+let graycolor = numeric ;
% color part (will be overloaded)
@@ -881,17 +882,19 @@ vardef penlabels@#(text t) =
endfor
enddef ;
+% range 4 thru 10
+
def range expr x =
- numtok[x]
+ _numtok_[x]
enddef ;
-def numtok suffix x =
+def _numtok_ suffix x =
x
enddef ;
tertiarydef m thru n =
m for x=m+1 step 1 until n :
- , numtok[x]
+ , _numtok_[x]
endfor
enddef ;
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index c0cb499fa..6dffd6cdb 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -1028,8 +1028,8 @@ vardef formatted(expr f, x) = textext(varfmt(f, x)) enddef ;
% new
-def eofill expr p = fill p withpostscript "evenodd" enddef ;
-def eoclip expr p = clip p withpostscript "evenodd" enddef ;
+def eofill text t = fill t withpostscript "evenodd" enddef ;
+%%% eoclip text t = clip t withpostscript "evenodd" enddef ; % no postscripts yet
% def withrule expr r =
% if (t = "even-odd") or (t = "evenodd") : withpostscript "evenodd" fi
diff --git a/metapost/context/base/mp-tool.mpiv b/metapost/context/base/mp-tool.mpiv
index a51017e23..e083a5b18 100644
--- a/metapost/context/base/mp-tool.mpiv
+++ b/metapost/context/base/mp-tool.mpiv
@@ -57,8 +57,13 @@ mpprocset := 1 ;
%
% protect ;
-string space ; space := char 32 ;
-string CRLF ; CRLF := char 10 & char 13 ;
+string space ; space := char 32 ;
+string crlf ; crlf := char 10 & char 13 ;
+string dquote ; dquote := char 34 ;
+
+let SPACE = space ;
+let CRLF = crlf ;
+let DQUOTE = dquote ;
vardef ddecimal primary p =
decimal xpart p & " " & decimal ypart p
@@ -90,8 +95,8 @@ newinternal graycolormodel ; graycolormodel := 3 ;
newinternal rgbcolormodel ; rgbcolormodel := 5 ;
newinternal cmykcolormodel ; cmykcolormodel := 7 ;
-let grayscale = numeric ;
-let greyscale = numeric ;
+let grayscale = graycolor ;
+let greyscale = greycolor ;
vardef colorpart expr c =
if not picture c :
@@ -774,8 +779,8 @@ vardef whitecolor(expr c) =
if cmykcolor c : (0,0,0,0) elseif rgbcolor c : (1,1,1) else : 1 fi
enddef ;
-vardef blackcolor(expr c) =
- if cmykcolor c : (0,0,0,1) elseif rgbcolor c : (0,0,0) else : 0 fi
+vardef blackcolor expr c =
+ if cmykcolor c : (0,0,0,1) elseif rgbcolor c : (0,0,0) else : 0 fi
enddef ;
%D Well, this is the dangerous and naive version:
@@ -1569,6 +1574,8 @@ vardef grayed primary p =
fi
enddef ;
+let greyed = grayed ;
+
% yes or no: "text" infont "cmr12" at 24pt ;
% let normalinfont = infont ;
@@ -2298,15 +2305,18 @@ vardef area expr p =
enddef ;
vardef basiccolors[] =
- save n ; n := @ mod 7 ;
- if n = 0 : white
- elseif n = 1 : red
- elseif n = 2 : green
- elseif n = 3 : blue
- elseif n = 4 : cyan
- elseif n = 5 : magenta
- elseif n = 6 : yellow
- else : black
+ if @ = 0 :
+ white
+ else :
+ save n ; n := @ mod 7 ;
+ if n = 1 : red
+ elseif n = 2 : green
+ elseif n = 3 : blue
+ elseif n = 4 : cyan
+ elseif n = 5 : magenta
+ elseif n = 6 : yellow
+ else : black
+ fi
fi
enddef ;
@@ -2494,7 +2504,7 @@ def endglyph =
endfig ;
enddef ;
-%D Dimensions have bever been an issue as traditional MP can't make that large
+%D Dimensions have never been an issue as traditional MP can't make that large
%D pictures, but with double mode we need a catch:
newinternal maxdimensions ; maxdimensions := 14000 ;