summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2013-08-24 01:32:00 +0200
committerHans Hagen <pragma@wxs.nl>2013-08-24 01:32:00 +0200
commitd1ee576345717d670c5ee5297222fab3a38762dc (patch)
treea68d6e992bcab7d8b138ea12aff23d6b6b34c6c7 /metapost
parentdeb71b2066bcd0091e3e677b6bae59d4f7e07acf (diff)
downloadcontext-d1ee576345717d670c5ee5297222fab3a38762dc.tar.gz
beta 2013.08.24 01:32
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mpiv9
-rw-r--r--metapost/context/base/mp-text.mpii7
2 files changed, 16 insertions, 0 deletions
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index 9a2042924..e768efaec 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -255,6 +255,15 @@ mfun_labtype.drt := 12 ;
mfun_labtype.origin := 0 ;
mfun_labtype.raw := 0 ;
+% installlabel.foo ( 0, 1, 1, (.5,-1) ) ;
+
+vardef installlabel@# (expr type, x, y, offset) =
+ numeric labtype@# ; labtype@# := type ;
+ pair laboff @# ; laboff @# := offset ;
+ numeric labxf @# ; labxf @# := x ;
+ numeric labyf @# ; labyf @# := y ;
+enddef ;
+
vardef thetextext@#(expr p,z) =
% interim labeloffset := textextoffset ;
if string p :
diff --git a/metapost/context/base/mp-text.mpii b/metapost/context/base/mp-text.mpii
index d529e9242..5f96f6788 100644
--- a/metapost/context/base/mp-text.mpii
+++ b/metapost/context/base/mp-text.mpii
@@ -109,6 +109,13 @@ pair laboff.raw ; laboff.raw = (0,0) ; % (infinity,infinity) ;
laboff.origin = (0,0) ; labxf.origin := 0 ; labyf.origin := 0 ;
laboff.raw = (0,0) ; labxf.raw := 0 ; labyf.raw := 0 ;
+vardef installlabel@# (expr type, x, y, offset) =
+ numeric labtype@# ; labtype@# := type ;
+ pair laboff @# ; laboff @# := offset ;
+ numeric labxf @# ; labxf @# := x ;
+ numeric labyf @# ; labyf @# := y ;
+enddef ;
+
vardef thelabel@#(expr s, z) =
save p ; picture p ;
p = s if not picture s : infont defaultfont scaled defaultscale fi ;