meta-imp-pre.mkiv /size: 2251 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=meta-pre,
3
%D version=2001.03.21,
4
%D title=\METAPOST\ Graphics,
5
%D subtitle=Predefined Goodies,
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
%D In this library, we define a couple of handy graphics.
15 16
% todo: use the predefine grid macros, mp code will move to
17
% mp-* file
18 19
\startuseMPgraphic
{
pagegrid
}
20
StartPage
;
21
drawoptions
(
withcolor
.8
white
)
;
22
fill
Field
[
Text
]
[
Text
]
;
23
drawoptions
(
withcolor
.65
white
)
;
24
fill
Field
[
Footer
]
[
Text
]
;
25
fill
Field
[
Header
]
[
Text
]
;
26
fill
Field
[
LeftMargin
]
[
Text
]
;
27
fill
Field
[
RightMargin
]
[
Text
]
;
28
drawoptions
(
withcolor
.65
yellow
)
;
29
fill
Field
[
LeftEdge
]
[
Text
]
;
30
fill
Field
[
RightEdge
]
[
Text
]
;
31
fill
Field
[
Bottom
]
[
Text
]
;
32
fill
Field
[
Top
]
[
Text
]
;
33
drawoptions
(
withpen
pencircle
scaled
.3
pt
withcolor
.65
white
)
;
34
for
i
=
-3
cm
step
1
cm
until
PaperWidth
+3
cm
:
35
draw
(
i
,
-3
cm
)
--
(
i
,
PaperHeight
+3
cm
)
;
36
endfor
;
37
for
i
=
PaperHeight
+3
cm
step
-1
cm
until
-3
cm
:
38
draw
(
-3
cm
,
i
)
--
(
PaperWidth
+3
cm
,
i
)
;
39
endfor
;
40
drawoptions
(
withpen
pencircle
scaled
.15
pt
)
;
41
for
i
=
.5
cm
-3
cm
step
1
cm
until
PaperWidth
+3
cm
:
42
draw
(
i
,
-3
cm
)
--
(
i
,
PaperHeight
+3
cm
)
;
43
endfor
;
44
for
i
=
PaperHeight
-.5
cm
+3
cm
step
-1
cm
until
-3
cm
:
45
draw
(
-3
cm
,
i
)
--
(
PaperWidth
+3
cm
,
i
)
;
46
endfor
;
47
drawoptions
(
withpen
pencircle
scaled
.3
pt
withcolor
.65
red
)
;
48
for
i
=
0
step
1
cm
until
PaperWidth
:
49
draw
(
i
,
0
)
--
(
i
,
PaperHeight
)
;
50
endfor
;
51
for
i
=
PaperHeight
step
-1
cm
until
0
:
52
draw
(
0
,
i
)
--
(
PaperWidth
,
i
)
;
53
endfor
;
54
drawoptions
(
withpen
pencircle
scaled
.15
pt
withcolor
.65
red
)
;
55
for
i
=
.5
cm
step
1
cm
until
PaperWidth
:
56
draw
(
i
,
0
)
--
(
i
,
PaperHeight
)
;
57
endfor
;
58
for
i
=
PaperHeight
-.5
cm
step
-1
cm
until
0
:
59
draw
(
0
,
i
)
--
(
PaperWidth
,
i
)
;
60
endfor
;
61
drawoptions
(
withpen
pencircle
scaled
5
pt
withcolor
.65
red
)
;
62
draw
ulcorner
Page
;
63
StopPage
;
64
\stopuseMPgraphic
65 66
\defineoverlay
[
pagegrid
][
\useMPgraphic
{
pagegrid
}
]
67 68
\endinput
69