summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/spac-grd.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/spac-grd.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/spac-grd.mkiv66
1 files changed, 56 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/base/spac-grd.mkiv b/Master/texmf-dist/tex/context/base/spac-grd.mkiv
index bd5c51a853e..8701f4d7ee2 100644
--- a/Master/texmf-dist/tex/context/base/spac-grd.mkiv
+++ b/Master/texmf-dist/tex/context/base/spac-grd.mkiv
@@ -126,12 +126,12 @@
{\def\dobaselinecorrection % visualization is not watertight!
{\bgroup
\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi
- \setbox0\null
- \wd0\hsize
- \dp0\strutdp
+ \setbox\scratchbox\emptyhbox
+ \wd\scratchbox\hsize
+ \dp\scratchbox\strutdp
\nointerlineskip
\forgetall
- \ruledvbox{\box0}%
+ \ruledvbox{\box\scratchbox}%
\egroup
\prevdepth\strutdp}%
\def\dotopbaselinecorrection
@@ -208,11 +208,11 @@
%D is not needed, but I want to look the visualization as good
%D as possible too.
-\chardef\baselinecorrectionmode\plusone
+\setnewconstant\baselinecorrectionmode\plusone
-\def\onbaselinecorrection {\chardef\baselinecorrectionmode\plusone }
-\def\offbaselinecorrection {\chardef\baselinecorrectionmode\plustwo }
-\def\forcebaselinecorrection{\chardef\baselinecorrectionmode\plusthree}
+\def\onbaselinecorrection {\baselinecorrectionmode\plusone }
+\def\offbaselinecorrection {\baselinecorrectionmode\plustwo }
+\def\forcebaselinecorrection{\baselinecorrectionmode\plusthree}
%D \macros
%D {topbaselinecorrection,botbaselinecorrection}
@@ -228,7 +228,7 @@
{\ifvmode
\bgroup
\setbaselinecorrections
- \whitespace
+ \whitespace % no longer ok
\nointerlineskip
\dotopbaselinecorrection
\egroup
@@ -246,11 +246,57 @@
\let\forcedbotbaselinecorrection\botbaselinecorrection
+% experiment, todo: proper mkiv mechanism
+%
+% \input ward \par
+% \startframedtext test \stopframedtext
+% \input ward \par
+% \startlinecorrection \framed{xxx} \stoplinecorrection
+% \input ward \par
+%
+% \setupwhitespace[big]
+%
+% \input ward \par
+% \startframedtext test \stopframedtext
+% \input ward \par
+% \startlinecorrection \framed{xxx} \stoplinecorrection
+% \input ward \par
+
+\def\dotopbaselinecorrection {\blank[\thetopbaselinecorrection ]}
+\def\dobotbaselinecorrection {\blank[\thebotbaselinecorrection ]}
+\def\donegtopbaselinecorrection{\blank[\thenegtopbaselinecorrection]}
+\def\donegbotbaselinecorrection{\blank[\thenegbotbaselinecorrection]}
+
+% nointerlineskip
+%
+% startpacked
+% \startlinecorrection \framed{test} \stoplinecorrection
+% \startlinecorrection \framed{test} \stoplinecorrection
+% \stoppacked
+
+\def\forcedtopbaselinecorrection
+ {\ifvmode
+ \bgroup
+ \setbaselinecorrections
+ \vspacing[white]
+% \nointerlineskip %
+ \dotopbaselinecorrection
+ \egroup
+\fi}
+
+\def\dobaselinecorrection
+ {\ifdim\prevdepth>\zeropoint
+ \vspacing[\the\dimexpr-\prevdepth+\strutdp\relax]%
+ \else
+ \vspacing[\the\dimexpr\strutdp\relax]%
+ \fi
+ \prevdepth\strutdp}
+
\let\normalstartbaselinecorrection\startbaselinecorrection
\unexpanded\def\startbaselinecorrection
{\ifgridsnapping
- \snaptogrid[v!normal]\vbox\bgroup
+ \snaptogrid[\v!normal]\vbox\bgroup
\let\stopbaselinecorrection\egroup
\else
\normalstartbaselinecorrection