summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-02-18 11:28:41 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-02-18 11:28:41 +0100
commit298afdcdcb9d3c88fcc9abdbf17ac66f2f5006a1 (patch)
tree44bbefa57072479622fa253684ec3cb96258255f /metapost
parent84aae20fa32c9a50ae1c63576573f52d010de43b (diff)
downloadcontext-298afdcdcb9d3c88fcc9abdbf17ac66f2f5006a1.tar.gz
2021-02-18 10:24:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpiv/mp-base.mpiv6
-rw-r--r--metapost/context/base/mpxl/mp-apos.mpxl6
-rw-r--r--metapost/context/base/mpxl/mp-base.mpxl2
-rw-r--r--metapost/context/base/mpxl/mp-lmtx.mpxl22
-rw-r--r--metapost/context/base/mpxl/mp-tool.mpxl11
5 files changed, 38 insertions, 9 deletions
diff --git a/metapost/context/base/mpiv/mp-base.mpiv b/metapost/context/base/mpiv/mp-base.mpiv
index 75dd4b4b0..08bd42c05 100644
--- a/metapost/context/base/mpiv/mp-base.mpiv
+++ b/metapost/context/base/mpiv/mp-base.mpiv
@@ -237,11 +237,13 @@ EOF = char 0 ; % end-of-file for readfrom and write..to
% pen constants
-pen pensquare, penrazor, penspeck ;
+pen pensquare, penrazor, penspec ;
pensquare = makepen(unitsquare shifted -(.5,.5)) ;
penrazor = makepen((-.5,0) -- (.5,0) -- cycle) ;
-penspeck = pensquare scaled eps ;
+penspec = pensquare scaled eps ;
+
+def penspeck = penspec enddef ;
% nullary operators
diff --git a/metapost/context/base/mpxl/mp-apos.mpxl b/metapost/context/base/mpxl/mp-apos.mpxl
index 3e7524b11..e3746540f 100644
--- a/metapost/context/base/mpxl/mp-apos.mpxl
+++ b/metapost/context/base/mpxl/mp-apos.mpxl
@@ -105,6 +105,8 @@ enddef ;
% new interface
-newscriptindex mfid_getposboxes ; mfid_getposboxes := scriptindex "getposboxes" ;
+newscriptindex mfid_getposboxes ; mfid_getposboxes := scriptindex "getposboxes" ;
+newscriptindex mfid_getmultipars ; mfid_getmultipars := scriptindex "getmultipars" ;
-def getposboxes(expr tags, anchor) = runscript mfid_getposboxes tags anchor ; enddef ;
+def getposboxes (expr tags, anchor) = runscript mfid_getposboxes tags anchor ; enddef ;
+def getmultipars(expr tags, anchor) = runscript mfid_getmultipars tags anchor ; enddef ;
diff --git a/metapost/context/base/mpxl/mp-base.mpxl b/metapost/context/base/mpxl/mp-base.mpxl
index 430e75a62..8086ee799 100644
--- a/metapost/context/base/mpxl/mp-base.mpxl
+++ b/metapost/context/base/mpxl/mp-base.mpxl
@@ -895,7 +895,7 @@ defaultscale := 1 ;
labeloffset := 3bp ;
dotlabeldiam := 3bp ;
-permanent defaultfont, defaultscale, labeloffset, dotlabeldiam ;
+mutable defaultfont, defaultscale, labeloffset, dotlabeldiam ;
vardef thelabel@#(expr s,z) = % Position s near z
save p ; picture p ;
diff --git a/metapost/context/base/mpxl/mp-lmtx.mpxl b/metapost/context/base/mpxl/mp-lmtx.mpxl
index a3866dff4..93791e7c5 100644
--- a/metapost/context/base/mpxl/mp-lmtx.mpxl
+++ b/metapost/context/base/mpxl/mp-lmtx.mpxl
@@ -2346,3 +2346,25 @@ primarydef p scrutenized n =
enddef ;
permanent scrutenized ;
+
+% for now here
+
+% newscriptindex mfid_mpv_numeric ; mfid_mpv_numeric := scriptindex "mpv_numeric" ;
+% newscriptindex mfid_mpv_dimension ; mfid_mpv_dimension := scriptindex "mpv_dimension" ;
+% newscriptindex mfid_mpv_string ; mfid_mpv_string := scriptindex "mpv_string" ;
+%
+% def mpv_numeric = runscript mfid_mpv_numeric enddef ;
+% def mpv_dimension = runscript mfid_mpv_dimension enddef ;
+% def mpv_string = runscript mfid_mpv_string enddef ;
+%
+% permanent mpv_numeric, mpv_dimension, mpv_string ;
+
+newscriptindex mfid_mpvar ; mfid_mpvar := scriptindex "mpvar" ;
+
+def mpvar = runscript mfid_mpvar enddef ;
+
+permanent mpvar ;
+
+% for old times sake (metafun manual)
+
+vardef textual primary p = false enddef ;
diff --git a/metapost/context/base/mpxl/mp-tool.mpxl b/metapost/context/base/mpxl/mp-tool.mpxl
index 59b29c148..1d515ffc8 100644
--- a/metapost/context/base/mpxl/mp-tool.mpxl
+++ b/metapost/context/base/mpxl/mp-tool.mpxl
@@ -1446,7 +1446,8 @@ vardef arrowhead expr p =
enddef ;
vardef drawarrowpath expr p =
- save autoarrows ; boolean autoarrows ; autoarrows := true ;
+% save autoarrows ; boolean autoarrows ; autoarrows := true ;
+ interim autoarrows := true ;
drawarrow p mfun_opt_pth
enddef ;
@@ -1455,8 +1456,8 @@ def midarrowhead expr p =
enddef ;
vardef arrowheadonpath (expr p, s) =
- save autoarrows ; boolean autoarrows ;
- autoarrows := true ;
+% save autoarrows ; boolean autoarrows ;
+ interim autoarrows := true ;
set_ahlength(scaled ahfactor) ; % added
arrowhead p if s < 1 : cutafter (point (s*arclength(p) + (ahlength/2)) on p) fi
enddef ;
@@ -1709,9 +1710,11 @@ extra_beginfig := extra_beginfig & " linecap := rounded ; " ; % restores
%D Normally, arrowheads don't scale well. So we provide a hack.
-boolean autoarrows ; autoarrows := false ; % todo: newinternal boolean autoarrows ;
+% boolean autoarrows ; autoarrows := false ; % todo: newinternal boolean autoarrows ;
numeric ahfactor ; ahfactor := 2.5 ; % todo: newinternal ahfactor ;
+newinternal boolean autoarrows ;
+
permanent ahfactor, ahlength, autoarrows ;
def set_ahlength (text t) = % called to often