summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2023-01-04 12:09:26 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2023-01-04 12:09:26 +0100
commit705b807c950a697d3c8be592c452a6fb3e561c7e (patch)
tree82904661aca945d008f07deb568ee7f05b55df4f /metapost
parent62d980c99a617ff260f29ac2d3bdb084049f25b0 (diff)
downloadcontext-705b807c950a697d3c8be592c452a6fb3e561c7e.tar.gz
2023-01-04 11:35:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpxl/mp-text.mpxl7
-rw-r--r--metapost/context/base/mpxl/mp-tool.mpxl12
2 files changed, 11 insertions, 8 deletions
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 ;