diff options
author | Hans Hagen <pragma@wxs.nl> | 2008-05-13 14:42:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2008-05-13 14:42:00 +0200 |
commit | d7e26feb7432f7bd29dd065fa578dc8395fb408f (patch) | |
tree | 607ced1d197efb172b8320b395a3b03a70b8b6fd /metapost | |
parent | 3d7afaa86d4d170aacd4d287e70149d22172bf4f (diff) | |
download | context-d7e26feb7432f7bd29dd065fa578dc8395fb408f.tar.gz |
stable 2008.05.13 14:42
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mp-mlib.mp | 12 | ||||
-rw-r--r-- | metapost/context/base/mp-text.mp | 7 |
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" ; |