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 .8white) ; 
22    fill Field[Text][Text] ; 
23    drawoptions(withcolor .65white) ; 
24    fill Field[Footer][Text] ; 
25    fill Field[Header][Text] ; 
26    fill Field[LeftMargin][Text] ; 
27    fill Field[RightMargin][Text] ; 
28    drawoptions(withcolor .65yellow) ; 
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 .3pt withcolor .65white) ; 
34    for i=-3cm step 1cm until PaperWidth+3cm : 
35      draw (i,-3cm)--(i,PaperHeight+3cm) ;
36    endfor ; 
37    for i=PaperHeight+3cm step -1cm until -3cm : 
38      draw (-3cm,i)--(PaperWidth+3cm,i) ;
39    endfor ; 
40    drawoptions(withpen pencircle scaled .15pt) ; 
41    for i=.5cm-3cm step 1cm until PaperWidth+3cm : 
42      draw (i,-3cm)--(i,PaperHeight+3cm) ;
43    endfor ; 
44    for i=PaperHeight-.5cm+3cm step -1cm until -3cm : 
45      draw (-3cm,i)--(PaperWidth+3cm,i) ;
46    endfor ; 
47    drawoptions(withpen pencircle scaled .3pt withcolor .65red) ; 
48    for i=0 step 1cm until PaperWidth : 
49      draw (i,0)--(i,PaperHeight) ;
50    endfor ; 
51    for i=PaperHeight step -1cm until 0 : 
52      draw (0,i)--(PaperWidth,i) ;
53    endfor ; 
54    drawoptions(withpen pencircle scaled .15pt withcolor .65red) ; 
55    for i=.5cm step 1cm until PaperWidth : 
56      draw (i,0)--(i,PaperHeight) ;
57    endfor ; 
58    for i=PaperHeight-.5cm step -1cm until 0 : 
59      draw (0,i)--(PaperWidth,i) ;
60    endfor ; 
61    drawoptions(withpen pencircle scaled 5pt withcolor .65red) ; 
62    draw ulcorner Page ; 
63  StopPage ;  
64\stopuseMPgraphic
65
66\defineoverlay[pagegrid][\useMPgraphic{pagegrid}]
67
68\endinput 
69