groff before CVS: release 1.06
[s-roff.git] / tmac / tmac.psfig
blobfca779f33a4e78e0383ab7b13437f01cb3af97e7
1 .\" These are macros to make psfig work with groff.
2 .\" They require that psfig be patched as described in ../ps/psfig.diff.
3 .de psfig-defs
4 ps: mdef 100
6 % wid ht llx lly urx ury psfigstart -
8 /psfigstart {
9         /level1 save def
10         /ury exch def
11         /urx exch def
12         /lly exch def
13         /llx exch def
14         /ht exch u def
15         /wid exch u def
16         currentpoint ht add translate
17         wid urx llx sub div ht ury lly sub div neg scale
18         llx neg lly neg translate
20         % set the graphics state to default values
21         0 setgray
22         0 setlinecap
23         1 setlinewidth
24         0 setlinejoin
25         10 setmiterlimit
26         [] 0 setdash
27         newpath
28         /showpage {} def
29 } bind def
31 % psfigclip -
33 /psfigclip {
34         currentpoint newpath
35         llx lly moveto
36         urx lly lineto
37         urx ury lineto
38         llx ury lineto
39         closepath clip
40         newpath moveto
41 } bind def
43 % psfigend -
45 /psfigend {
46         level1 restore
47 } bind def
49 % globalstart -
51 /globalstart {
52         % save the current space code on the stack
53         SC
54         level0 restore
55 } bind def
57 % globalend -
59 /globalend {
60         end
61         BP
62         /SC exch def
63         DEFS begin
64 } bind def
66 .de psfig-init
67 .if \\n[.P] \{\
68 \Y[psfig-defs]
69 .       br
70 .       sp -1
71 .       ds psfig-init\" empty
72 .       rm psfig-defs
73 .\}
75 .de F+
76 .br
77 .psfig-init
78 .nr psfig-fill \\n[.u]
79 .nf
80 .sp -.5
81 .if !\\n[.$] .ce 9999
83 .de F-
84 .br
85 .ce 0
86 .if \\n[psfig-fill] .fi