grph-rul.mkiv /size: 2973 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=grph-rul,
3%D        version=2016.02.05, % from experiments
4%D          title=\CONTEXT\ Graphic Macros,
5%D       subtitle=Rule Trickery,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Graphic Macros / Rule Trickery}
15
16\registerctxluafile{grph-rul}{}
17
18\unprotect
19
20\unexpanded\def\frule{\relax\clf_frule} % kind of low level
21
22% just for fun:
23
24% \defineoverlay[normalframe]
25%   [\frule
26%      width \overlaywidth
27%      height\overlayheight
28%      line  \overlaylinewidth
29%    \relax]
30
31% \defineoverlay[ovalframe]
32%   [\frule
33%      width  \overlaywidth
34%      height \overlayheight
35%      line   \overlaylinewidth
36%      radius \overlayradius
37%    \relax]
38
39\protect \endinput
40
41% \starttext
42%
43% \testfeatureonce{25}{\dontleavehmode
44%     \ruledhbox\bgroup
45%         \red   \frule width 2cm height 2cm depth 1cm radius 2mm  line 2pt type fill\relax
46%         \hskip-2cm
47%         \green \frule width 2cm height 2cm depth 1cm radius 2mm line 2pt\relax
48%     \egroup
49% \space}
50%
51% \blank
52%
53% \startuseMPgraphic{demoshape:back}
54%     fill
55%         unitcircle xysized (RuleWidth,RuleHeight+RuleDepth)
56%         withcolor RuleColor ;
57% \stopuseMPgraphic
58%
59% \startuseMPgraphic{demoshape:fore}
60%     draw
61%         unitcircle xysized (RuleWidth,RuleHeight+RuleDepth)
62%         withcolor RuleColor
63%         withpen pencircle scaled RuleThickness ;
64% \stopuseMPgraphic
65%
66% \testfeatureonce{100}{\dontleavehmode
67%     \ruledhbox\bgroup
68%         \red   \frule width 1cm height 3mm depth 1mm type mp line 2pt data {\includeMPgraphic{demoshape:back}}\relax
69%         \hskip-1cm
70%         \green \frule width 1cm height 3mm depth 1mm type mp line 2pt data {\includeMPgraphic{demoshape:fore}}\relax
71%     \egroup
72% \space}
73%
74% \blank
75%
76% \dontleavehmode
77% \testfeatureonce{1}{\setbox\scratchbox\hbox{\framed                                  {test}}}
78%                                             \framed                                  {test}
79% \testfeatureonce{1}{\setbox\scratchbox\hbox{\framed[background=normalframe,frame=off]{test}}}
80%                                             \framed[background=normalframe,frame=off]{test}
81% \testfeatureonce{1}{\setbox\scratchbox\hbox{\framed[corner=round]                    {test}}}
82%                                             \framed[corner=round]                    {test}
83% \testfeatureonce{1}{\setbox\scratchbox\hbox{\framed[background=ovalframe,frame=off]  {test}}}
84%                                             \framed[background=ovalframe,frame=off]  {test}
85% \testfeatureonce{1}{\setbox\scratchbox\hbox{\framed[background=ovalframe,frame=on]   {test}}}
86%                                             \framed[background=ovalframe,frame=on]   {test}
87%
88% \stoptext
89
90