diff options
Diffstat (limited to 'tex/context/base/core-mis.mkiv')
-rw-r--r-- | tex/context/base/core-mis.mkiv | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/tex/context/base/core-mis.mkiv b/tex/context/base/core-mis.mkiv index bb07f0628..417ea4c3d 100644 --- a/tex/context/base/core-mis.mkiv +++ b/tex/context/base/core-mis.mkiv @@ -1973,21 +1973,47 @@ % We do a bit more calculations than needed, simply because that way % it's easier to debug the code. -\def\dododorotatenextbox - {\setbox\nextbox\vbox to \@@layerysiz - {\vfill - \hbox to \@@layerxsiz - {\dostartrotation\@@rorotation - \nextboxwd\zeropoint - \nextboxht\zeropoint - \flushnextbox - \dostoprotation - \hfill}% - \kern\@@layerypos}% - \setbox\nextbox\hbox - {\kern\@@layerxpos - \kern\@@layerxoff - \lower\@@layeryoff\flushnextbox}} +% We can completely do this in lua .. when 'I'm bored ... + +% \def\dododorotatenextbox +% {\setbox\nextbox\vbox to \@@layerysiz +% {\vfill +% \hbox to \@@layerxsiz +% {\dostartrotation\@@rorotation +% \nextboxwd\zeropoint +% \nextboxht\zeropoint +% \flushnextbox +% \dostoprotation +% \hfill}% +% \kern\@@layerypos}% +% \setbox\nextbox\hbox +% {\kern\@@layerxpos +% \kern\@@layerxoff +% \lower\@@layeryoff\flushnextbox}} + +\def\dorotatenextbox#1#2% + {\hbox\bgroup + \edef\@@rorotation{#1}% + \ifx\@@rorotation\empty + \else + \ifx\@@rorotation\v!left + \doifoddpageelse{\edef\@@rorotation{90}}{\edef\@@rorotation{270}}% + \else\ifx\@@rorotation\v!right + \doifoddpageelse{\edef\@@rorotation{270}}{\edef\@@rorotation{90}}% + \else\ifx\@@rorotation\v!outer + \signalrightpage + \doifrightpageelse{\edef\@@rorotation{270}}{\edef\@@rorotation{90}}% + \else\ifx\@@rorotation\v!inner + \signalrightpage + \doifrightpageelse{\edef\@@rorotation{90}}{\edef\@@rorotation{270}}% + \else + \edef\@@rorotation{\realnumber{\@@rorotation}}% get rid of leading zeros and spaces + \fi\fi\fi\fi + \setbox\nextbox\vbox{\flushnextbox}% not really needed + \dodorotatenextbox\@@rorotation#2% + \fi + \boxcursor\flushnextbox + \egroup} \def\dodorotatenextbox#1#2% quite some trial and error -) {\dontshowcomposition |