1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Packaging Macros Fences for Ruled Content}
15
16
17
18
19
20
21
22
23
24
25
26
27
28\unprotect
29
30\def\installleftframerenderer#1#2
31 {\setvalue{\??framedleft\v!on#1}{\whateverleftframe{#2}}
32 \expandafter\let\csname\??framedleft\v!off#1\expandafter\endcsname\csname\??framedleft\v!on#1\endcsname}
33
34\def\installrightframerenderer#1#2
35 {\setvalue{\??framedright\v!on#1}{\whateverrightframe{#2}}
36 \expandafter\let\csname\??framedright\v!off#1\expandafter\endcsname\csname\??framedright\v!on#1\endcsname}
37
38\def\installtopframerenderer#1#2
39 {\setvalue{\??framedtop\v!on#1}{\whatevertopframe{#2}}
40 \expandafter\let\csname\??framedtop\v!off#1\expandafter\endcsname\csname\??framedtop\v!on#1\endcsname}
41
42\def\installbottomframerenderer#1#2
43 {\setvalue{\??framedbottom\v!on#1}{\whateverbottomframe{#2}}
44 \expandafter\let\csname\??framedbottom\v!off#1\expandafter\endcsname\csname\??framedbottom\v!on#1\endcsname}
45
46\ifdefined \pack_framed_overlay_initialize_indeed
47
48 \let\setinstalledframedimensions\pack_framed_overlay_initialize_indeed
49
50\else
51
52 \def\setinstalledframedimensions
53 {\d_overlay_width \frameddimenwd
54 \d_overlay_height \dimexpr\frameddimenht\frameddimendp\relax
55 \d_overlay_depth \frameddimendp
56 \d_overlay_linewidth \ruledlinewidth
57 \edef\overlaycolor {\framedparameter\c!backgroundcolor}
58 \edef\overlaylinecolor{\framedparameter\c!framecolor}}
59
60\fi
61
62\newbox\b_framed_rendered
63
64\def\whateverleftframe#1
65 {\setinstalledframedimensions
66 \setbox\b_framed_rendered\vpack to \d_overlay_height{\vss#1\vss}
67 \setbox\b_framed_rendered\hpack to \zeropoint{\box\b_framed_rendered\hss}
68 \ht\b_framed_rendered\zeropoint
69 \dp\b_framed_rendered\zeropoint
70 \box\b_framed_rendered}
71
72\def\whateverrightframe#1
73 {\setinstalledframedimensions
74 \setbox\b_framed_rendered\vpack to \d_overlay_height{\vss#1\vss}
75 \setbox\b_framed_rendered\hpack to \zeropoint{\hss\box\b_framed_rendered}
76 \ht\b_framed_rendered\zeropoint
77 \dp\b_framed_rendered\zeropoint
78 \box\b_framed_rendered}
79
80\def\whatevertopframe#1
81 {\setinstalledframedimensions
82 \setbox\b_framed_rendered\hpack to \d_overlay_width{\hss#1\hss}
83 \setbox\b_framed_rendered\vpack to \zeropoint{\box\b_framed_rendered\vss}
84 \ht\b_framed_rendered\zeropoint
85 \dp\b_framed_rendered\zeropoint
86 \box\b_framed_rendered
87 \nointerlineskip}
88
89\def\whateverbottomframe#1
90 {\setinstalledframedimensions
91 \setbox\b_framed_rendered\hpack to \d_overlay_width{\hss#1\hss}
92 \setbox\b_framed_rendered\vpack to \zeropoint{\vss\box\b_framed_rendered}
93 \ht\b_framed_rendered\zeropoint
94 \dp\b_framed_rendered\zeropoint
95 \box\b_framed_rendered}
96
97\protect \endinput
98 |