diff options
author | Hans Hagen <pragma@wxs.nl> | 2012-01-05 19:27:17 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2012-01-05 19:27:17 +0100 |
commit | 94124bc6ebef1359c1994f9ec64ac5161d2db276 (patch) | |
tree | 7194dbd5b321beba4d4addd426ecd97d304390db /metapost | |
parent | 9fb6251be7393901502aa2039dfdc7057a2e5aa7 (diff) | |
download | context-94124bc6ebef1359c1994f9ec64ac5161d2db276.tar.gz |
beta 2011.11.02 20:10
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mp-mlib.mpiv | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv index 329683f8c..eaef033a9 100644 --- a/metapost/context/base/mp-mlib.mpiv +++ b/metapost/context/base/mp-mlib.mpiv @@ -54,12 +54,11 @@ vardef transparency_alternative_to_number(expr name) = fi enddef ; -% def namedcolor(expr n, v) = -% 1 -% withprescript "sp_type=named" -% withprescript "sp_name=" & n -% withprescript "sp_value=" & v -% enddef ; +def namedcolor (expr n) = + 1 + withprescript "sp_type=named" + withprescript "sp_name=" & n +enddef ; def spotcolor(expr n, v) = 1 @@ -157,6 +156,16 @@ enddef ; defaultfont := "Mono" ; % was cmr10, could be lmmono10-regular, but is fed into context anyway +vardef fontsize expr str = + save size ; numeric size ; + size := bbwidth(textext("\MPfontsizehskip{" & defaultfont & "}")) ; + if size = 0 : + 12pt + else : + size + fi +enddef ; + pair mfun_laboff ; mfun_laboff := (0,0) ; pair mfun_laboff.lft ; mfun_laboff.lft := (-1,0) ; pair mfun_laboff.rt ; mfun_laboff.rt := (1,0) ; |