Implement false groff:[09040dbf] used to fix #47161
[s-roff.git] / tmac / psfig.tmac
blob1e50f9e369a1d733fb7977c8e9cc73b387f6a9f6
1 .\"@ psfig.tmac
2 .\"@ These are macros to make psfig work with groff.
3 .\"@ They require that psfig be patched as described in ../grops/psfig.diff.
4 .\"
5 .\" Adapted to S-roff by Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
7 .de psfig-defs
8 ps: mdef 100
10 % wid ht llx lly urx ury psfigstart -
12 /psfigstart {
13         /level1 save def
14         /ury exch def
15         /urx exch def
16         /lly exch def
17         /llx exch def
18         /ht exch u def
19         /wid exch u def
20         currentpoint ht add translate
21         wid urx llx sub div ht ury lly sub div neg scale
22         llx neg lly neg translate
24         % set the graphics state to default values
25         0 setgray
26         0 setlinecap
27         1 setlinewidth
28         0 setlinejoin
29         10 setmiterlimit
30         [] 0 setdash
31         newpath
32         /showpage {} def
33 } bind def
35 % psfigclip -
37 /psfigclip {
38         currentpoint newpath
39         llx lly moveto
40         urx lly lineto
41         urx ury lineto
42         llx ury lineto
43         closepath clip
44         newpath moveto
45 } bind def
47 % psfigend -
49 /psfigend {
50         level1 restore
51 } bind def
53 % globalstart -
55 /globalstart {
56         % save the current space code on the stack
57         SC
58         level0 restore
59 } bind def
61 % globalend -
63 /globalend {
64         end
65         BP
66         /SC exch def
67         DEFS begin
68 } bind def
70 .de psfig-init
71 .if \\n[.P] \{\
72 \Y[psfig-defs]
73 .       br
74 .       sp -1
75 .       ds psfig-init\" empty
76 .       rm psfig-defs
77 .\}
79 .de F+
80 .br
81 .psfig-init
82 .nr psfig-fill \\n[.u]
83 .nf
84 .sp -.5
85 .if !\\n[.$] .ce 9999
87 .de F-
88 .br
89 .ce 0
90 .if \\n[psfig-fill] .fi
92 .\" s-ts-mode