summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-11-02 21:20:13 +0200
committerMarius <mariausol@gmail.com>2011-11-02 21:20:13 +0200
commit90e916b32378e7977b12866e008a073b07c25378 (patch)
tree18a79c67da7e83db4e351988eee0ca7f0a3bafe3 /metapost
parent84bef3a2d8fc0c5074bf0d179f811ad0219b70be (diff)
downloadcontext-90e916b32378e7977b12866e008a073b07c25378.tar.gz
beta 2011.11.02 20:10
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mpiv21
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) ;