summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mp12
-rw-r--r--metapost/context/base/mp-text.mp7
2 files changed, 10 insertions, 9 deletions
diff --git a/metapost/context/base/mp-mlib.mp b/metapost/context/base/mp-mlib.mp
index dad7ab787..6722c81e4 100644
--- a/metapost/context/base/mp-mlib.mp
+++ b/metapost/context/base/mp-mlib.mp
@@ -29,7 +29,7 @@ enddef ;
extra_endfig := ";draw _tt_p_; " & extra_endfig ;
extra_beginfig := extra_beginfig & "resettextexts;";
-vardef textext(expr str) =
+vardef rawtextext(expr str) =
if _trial_run_ :
image (
_tt_n_ := _tt_n_ + 1 ;
@@ -42,7 +42,6 @@ vardef textext(expr str) =
else :
image (
_tt_n_ := _tt_n_ + 1 ;
- show _tt_n_ ;
draw unitsquare
xscaled _tt_w_[_tt_n_]
yscaled (_tt_h_[_tt_n_] + _tt_d_[_tt_n_])
@@ -52,6 +51,15 @@ vardef textext(expr str) =
fi
enddef ;
+vardef textext@#(expr txt) =
+ interim labeloffset := textextoffset ;
+ if string txt :
+ thelabel@#(rawtextext(txt),origin)
+ else :
+ thelabel@#(txt,origin)
+ fi
+enddef ;
+
def circular_shade (expr p, n, ca, cb) =
begingroup ;
save ab, r ; pair ab ; numeric r ;
diff --git a/metapost/context/base/mp-text.mp b/metapost/context/base/mp-text.mp
index 2e061df09..c1f9c80e9 100644
--- a/metapost/context/base/mp-text.mp
+++ b/metapost/context/base/mp-text.mp
@@ -61,18 +61,11 @@ vardef textext@#(expr txt) =
interim labeloffset := textextoffset ;
noftexpictures := noftexpictures + 1 ;
if string txt :
-% if textextstring <> "" :
-% _s_ := "verbatimtex " & textextstring & " etex ;" ;
-% else :
-% _s_ := "" ;
-% fi ;
if hobbiestextext : % the tex.mp method as fallback (see tex.mp)
-% write _s_ to "mptextmp.mp" ;
write _s_ & "btex " & txt & " etex" to "mptextmp.mp" ;
write EOF to "mptextmp.mp" ;
scantokens "input mptextmp"
else :
-% write "% setup : " & _s_ to jobname & ".mpt" ;
write "% figure " & decimal charcode & " : " &
"texpictures[" & decimal noftexpictures & "] := btex " &
txt & " etex ;" to jobname & ".mpt" ;