summaryrefslogtreecommitdiff
path: root/tex/context/base/supp-box.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/supp-box.mkiv')
-rw-r--r--tex/context/base/supp-box.mkiv68
1 files changed, 49 insertions, 19 deletions
diff --git a/tex/context/base/supp-box.mkiv b/tex/context/base/supp-box.mkiv
index de1da677a..a8774e482 100644
--- a/tex/context/base/supp-box.mkiv
+++ b/tex/context/base/supp-box.mkiv
@@ -75,9 +75,10 @@
%D core macros \type {\strutdepth} and alike, which are
%D values.
-\def\strutdp{\dp\strutbox}
-\def\strutht{\ht\strutbox}
-\def\strutwd{\wd\strutbox}
+\def\strutdp {\dp\strutbox}
+\def\strutht {\ht\strutbox}
+\def\strutwd {\wd\strutbox}
+\def\struthtdp{\dimexpr\ht\strutbox+\dp\strutbox\relax}
%D \macros
%D {voidbox,nextbox}
@@ -1236,7 +1237,7 @@
\ifdone \else
\parfillskip\zeropoint
\rightskip\zeropoint
- \hskip\zeropoint \!!plus 1\!!fill % \hsize
+ \hskip\zeropoint \s!plus 1\s!fill % \hsize
\fi
\unhcopy0}%
\ifdim\ht\nextbox>\strutht
@@ -1423,12 +1424,27 @@
{\setbox\nextbox\hbox
{\strut
\dp\nextbox\zeropoint
- \lower\strutdepth\box\nextbox}%
- \dp\nextbox\strutdepth
- \ht\nextbox\strutheight
+ \lower\strutdp\box\nextbox}%
+ \dp\nextbox\strutdp
+ \ht\nextbox\strutht
\box\nextbox
\egroup}
+%D A variant on this:
+
+\unexpanded\def\inlinedbox
+ {\bgroup
+ \dowithnextbox
+ {\setbox\nextbox\hbox
+ {\lower
+ \dimexpr(\htdp\nextbox-\lineheight)/\plustwo+\strutdp\relax
+ \box\nextbox}%
+ \ht\nextbox\strutht
+ \dp\nextbox\strutdp
+ \box\nextbox
+ \egroup}%
+ \hbox}
+
%D \macros
%D {struttedbox}
%D
@@ -1513,8 +1529,8 @@
\bgroup
\dontcomplain
\forgetall
- \setbox0\hbox{\vrule\!!width \zeropoint#1}%
- \setbox2\vbox{\hrule\!!height\zeropoint#1}%
+ \setbox0\hbox{\vrule\s!width \zeropoint#1}%
+ \setbox2\vbox{\hrule\s!height\zeropoint#1}%
\advance\vsize \ht2
\advance\hsize \wd0
\vbox to \vsize
@@ -1573,9 +1589,9 @@
{\bgroup
\dowithnextbox
{\setlocalhsize
- \setbox\scratchbox\hbox{\vrule\!!width \zeropoint#1}%
+ \setbox\scratchbox\hbox{\vrule\s!width \zeropoint#1}%
\ifzeropt\wd\scratchbox\else\hsize\wd\scratchbox\fi
- \setbox\scratchbox\vbox{\hrule\!!height\zeropoint#1}%
+ \setbox\scratchbox\vbox{\hrule\s!height\zeropoint#1}%
\ifzeropt\ht\scratchbox\else\vsize\ht\scratchbox\fi
\vbox to \vsize{\vss\hbox to \hsize{\hss\box\nextbox\hss}\vss}%
\egroup}%
@@ -1791,7 +1807,7 @@
\ifvoid\unhhedbox
\exitloop
\else
- \hskip\zeropoint \!!plus \zeropoint
+ \hskip\zeropoint \s!plus \zeropoint
\fi}%
\egroup}
@@ -2169,7 +2185,7 @@
\newbox\fakedboxcursor
\setbox\fakedboxcursor\hbox
- {\vrule\!!width\zeropoint\!!height\zeropoint\!!depth\zeropoint}
+ {\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
\unexpanded\def\boxcursor % overloaded in core-vis
{\iftraceboxplacement
@@ -2178,9 +2194,9 @@
\setbox\scratchbox\hbox to \zeropoint
{\hss
\vrule
- \!!width \scratchdimen
- \!!height\scratchdimen
- \!!depth \scratchdimen
+ \s!width \scratchdimen
+ \s!height\scratchdimen
+ \s!depth \scratchdimen
\hss}%
\smashedbox\scratchbox
\egroup
@@ -2431,15 +2447,14 @@
%D \macros
%D {makestrutofbox}
%D
-%D This macro sets the dimensions of a box to those of a
-%D strut.
+%D This macro sets the dimensions of a box to those of a strut.
\def\domakestrutofbox
{\ht\c_boxes_register\strutht
\dp\c_boxes_register\strutdp
\wd\c_boxes_register\zeropoint}
-\unexpanded\def\makestrutofbox
+\unexpanded\def\makestrutofbox % not used
{\afterassignment\domakestrutofbox\c_boxes_register}
%D \macros
@@ -2615,6 +2630,21 @@
% \showboxbreadth\maxdimen
% \showboxdepth \maxdimen
+%D Moved from cont-new:
+%D
+%D \starttyping
+%D \minimalhbox 100pt {test}
+%D \stoptyping
+
+\unexpanded\def\minimalhbox#1#%
+ {\dowithnextbox
+ {\bgroup
+ \setbox\scratchbox\hbox#1{\hss}%
+ \ifdim\wd\nextbox<\wd\scratchbox\wd\nextbox\wd\scratchbox\fi
+ \box\nextbox
+ \egroup}
+ \hbox}
+
\protect \endinput
% a bit of test code: