diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/pack-fen.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/pack-fen.mkiv | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/pack-fen.mkiv b/Master/texmf-dist/tex/context/base/pack-fen.mkiv new file mode 100644 index 00000000000..575c4684931 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/pack-fen.mkiv @@ -0,0 +1,97 @@ +%D \module +%D [ file=pack-fen, +%D version=2011.07.21, +%D title=\CONTEXT\ Packaging Macros, +%D subtitle= Fences for Ruled Content, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Packaging Macros / Fences for Ruled Content} + +%D \startbuffer +%D \useMPlibrary[meta-imp-hooks.mkiv] +%D +%D \framed[frame=off,bottomframe=righthook]{Bottom right hook} +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection + +\unprotect + +\def\installleftframerenderer#1#2% + {\setvalue{\??framedleft\v!on#1}{\whateverleftframe{#2}}% + \expandafter\let\csname\??framedleft\v!off#1\expandafter\endcsname\csname\??framedleft\v!on#1\endcsname} + +\def\installrightframerenderer#1#2% + {\setvalue{\??framedright\v!on#1}{\whateverrightframe{#2}}% + \expandafter\let\csname\??framedright\v!off#1\expandafter\endcsname\csname\??framedright\v!on#1\endcsname} + +\def\installtopframerenderer#1#2% + {\setvalue{\??framedtop\v!on#1}{\whatevertopframe{#2}}% + \expandafter\let\csname\??framedtop\v!off#1\expandafter\endcsname\csname\??framedtop\v!on#1\endcsname} + +\def\installbottomframerenderer#1#2% + {\setvalue{\??framedbottom\v!on#1}{\whateverbottomframe{#2}}% + \expandafter\let\csname\??framedbottom\v!off#1\expandafter\endcsname\csname\??framedbottom\v!on#1\endcsname} + +\ifdefined \pack_framed_overlay_initialize_indeed + + \let\installedframedimensions\pack_framed_overlay_initialize_indeed + +\else + + \def\setinstalledframedimensions + {\edef\overlaywidth {\the\frameddimenwd\space}% + \edef\overlayheight {\the\dimexpr\frameddimenht+\frameddimendp\relax\space}% + \edef\overlaydepth {\the\frameddimendp\space}% + \edef\overlaycolor {\framedparameter\c!backgroundcolor}% + \edef\overlaylinecolor{\framedparameter\c!framecolor}% + \edef\overlaylinewidth{\the\ruledlinewidth}} + +\fi + +\newbox\b_framed_rendered + +\def\whateverleftframe#1% + {\setinstalledframedimensions + \setbox\b_framed_rendered\vbox to \overlayheight{\vss#1\vss}% + \setbox\b_framed_rendered\hbox to \zeropoint{\box\b_framed_rendered\hss}% + \ht\b_framed_rendered\zeropoint + \dp\b_framed_rendered\zeropoint + \box\b_framed_rendered} + +\def\whateverrightframe#1% + {\setinstalledframedimensions + \setbox\b_framed_rendered\vbox to \overlayheight{\vss#1\vss}% + \setbox\b_framed_rendered\hbox to \zeropoint{\hss\box\b_framed_rendered}% + \ht\b_framed_rendered\zeropoint + \dp\b_framed_rendered\zeropoint + \box\b_framed_rendered} + +\def\whatevertopframe#1% + {\setinstalledframedimensions + \setbox\b_framed_rendered\hbox to \overlaywidth{\hss#1\hss}% + \setbox\b_framed_rendered\vbox to \zeropoint{\box\b_framed_rendered\vss}% + \ht\b_framed_rendered\zeropoint + \dp\b_framed_rendered\zeropoint + \box\b_framed_rendered + \nointerlineskip} + +\def\whateverbottomframe#1% + {\setinstalledframedimensions + \setbox\b_framed_rendered\hbox to \overlaywidth{\hss#1\hss}% + \setbox\b_framed_rendered\vbox to \zeropoint{\vss\box\b_framed_rendered}% + \ht\b_framed_rendered\zeropoint + \dp\b_framed_rendered\zeropoint + \box\b_framed_rendered} + +\protect \endinput |