From 705b807c950a697d3c8be592c452a6fb3e561c7e Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 4 Jan 2023 12:09:26 +0100 Subject: 2023-01-04 11:35:00 --- metapost/context/base/mpxl/mp-text.mpxl | 7 ++++--- metapost/context/base/mpxl/mp-tool.mpxl | 12 +++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'metapost') diff --git a/metapost/context/base/mpxl/mp-text.mpxl b/metapost/context/base/mpxl/mp-text.mpxl index c18647baf..b3f1adf34 100644 --- a/metapost/context/base/mpxl/mp-text.mpxl +++ b/metapost/context/base/mpxl/mp-text.mpxl @@ -18,7 +18,8 @@ if known metafun_loaded_text : endinput ; fi ; newinternal boolean metafun_loaded_text ; metafun_loaded_text := true ; immutable metafun_loaded_text ; % This is still mostly the same as the one discussed in the good old \METAFUN\ -% example code but modernized abit to suit \LMTX. +% example code but modernized abit to suit \LMTX. We can actually use \hsplit +% now! newscriptindex mfid_setparshapeproperty ; mfid_setparshapeproperty := scriptindex "setparshapeproperty" ; @@ -123,9 +124,9 @@ def lmt_do_parshape = % todo: check and improve this rather oldie save a, b; pair a, b ; a := pat intersection_point (lin shifted (0,strutheight)) ; if intersection_found : - a := a shifted (0,-strutheight) ; + a := a shifted (0,-strutheight) ; else : - a := pat intersection_point lin ; + a := pat intersection_point lin ; fi ; b := pat intersection_point (lin shifted (0,-strutdepth)) ; if intersection_found : diff --git a/metapost/context/base/mpxl/mp-tool.mpxl b/metapost/context/base/mpxl/mp-tool.mpxl index 7b7814eef..adc2d1510 100644 --- a/metapost/context/base/mpxl/mp-tool.mpxl +++ b/metapost/context/base/mpxl/mp-tool.mpxl @@ -3390,22 +3390,24 @@ permanent break ; % primarydef p xstretched w = ( % p if (bbwidth (p)>0) and (w>0) : xscaled (w/bbwidth (p)) fi % ) enddef ; +% +% primarydef p ystretched h = ( +% p if (bbheight(p)>0) and (h>0) : yscaled (h/bbheight(p)) fi +% ) enddef ; + primarydef p xstretched w = ( begingroup save l, r ; pair r; r := xrange p ; l := ypart r - xpart r ; - p if (l > 0) and (w > 0) : xscaled (w/l (p)) fi + p if (l > 0) and (w > 0) : xscaled (w/l) fi endgroup ) enddef ; -% primarydef p ystretched h = ( -% p if (bbheight(p)>0) and (h>0) : yscaled (h/bbheight(p)) fi -% ) enddef ; primarydef p ystretched h = ( begingroup save l, r ; pair r; r := yrange p ; l := ypart r - xpart r ; - p if (l > 0) and (h > 0) : yscaled (h/l (p)) fi + p if (l > 0) and (h > 0) : yscaled (h/l) fi endgroup ) enddef ; -- cgit v1.2.3