diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-11-18 16:12:36 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-11-18 16:12:36 +0100 |
commit | 744095aa4676553437db0d71c281a74557a3222f (patch) | |
tree | bfdf5d203b5fbfa44ee7db705d3b3475361ad28f /metapost | |
parent | e2ee706a3114129601a30908d6b8cbb57068d32c (diff) | |
download | context-744095aa4676553437db0d71c281a74557a3222f.tar.gz |
2018-11-18 14:16:00
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mpiv/mp-luas.mpiv | 19 | ||||
-rw-r--r-- | metapost/context/base/mpiv/mp-mlib.mpiv | 6 |
2 files changed, 20 insertions, 5 deletions
diff --git a/metapost/context/base/mpiv/mp-luas.mpiv b/metapost/context/base/mpiv/mp-luas.mpiv index 293ebadaf..e5cfe0371 100644 --- a/metapost/context/base/mpiv/mp-luas.mpiv +++ b/metapost/context/base/mpiv/mp-luas.mpiv @@ -225,8 +225,23 @@ vardef texstr(expr name) = lua.mp.texstr(name) enddef ; % endfor cycle ; % \stopMPcode -def inpath suffix p = - = 1 step 1 until lua.mp.mf_path_length(str p) +% def inpath suffix p = +% = 1 step 1 until lua.mp.mf_path_length(str p) +% enddef ; + +% def inpath suffix p = +% % = 1 step 1 until lua.mp.mf_path_length(str p) +% = 1 step 1 until (begingroup save n ; n := lua.mp.mf_path_length(str p) ; if n = 0 : 1 else : n fi endgroup) +% enddef ; + +def inpath suffix p = % permits p[0] + = 1 step 1 until + begingroup + save mfun_inpath_r,mfun_inpath_n ; path mfun_inpath_r ; + mfun_inpath_r = p ; + mfun_inpath_n := lua.mp.mf_path_length(str mfun_inpath_r) ; + if mfun_inpath_n = 0 : 1 else : mfun_inpath_n fi + endgroup enddef ; vardef pointof primary i = lua.mp.mf_path_point(i) enddef ; diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv index b7fc60b21..eb7b13834 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -605,7 +605,7 @@ enddef; vardef thelabel@#(expr p,z) = if numeric p : - thelabel@#(decimal p) + thelabel@#(decimal p,z) elseif string p : thelabel@#(rawtextext("\definedfont[" & defaultfont & "]" & p) scaled defaultscale,z) else : @@ -1771,8 +1771,8 @@ enddef ; vardef strfmt(expr f, x) = "\MPgraphformat{" & escaped_format(f) & "}{" & mfun_tagged_string(x) & "}" enddef ; vardef varfmt(expr f, x) = "\MPformatted{" & escaped_format(f) & "}{" & mfun_tagged_string(x) & "}" enddef ; -vardef format (expr f, x) = textext(strfmt(f, x)) enddef ; -vardef formatted(expr f, x) = textext(varfmt(f, x)) enddef ; +vardef format@# (expr f, x) = textext@#(strfmt(f, x)) enddef ; +vardef formatted@#(expr f, x) = textext@#(varfmt(f, x)) enddef ; % could be this (something to discuss with alan as it involves graph): % |