groff before CVS: release 1.05
[s-roff.git] / ps / tmac.pspic
blob9923907ff716f76a85e323c66bd7ff601964f52f
1 .\" Define the PSPIC macro.
2 .\" When used other than with -Tps, it will draw a box around where
3 .\" the picture would go.
4 .de ps-bb
5 .nr ps-nargs \\n[.$]
6 .if \\n[ps-nargs]=4 \{\
7 .       nr ps-llx 0\\$1
8 .       nr ps-lly 0\\$2
9 .       nr ps-urx 0\\$3
10 .       nr ps-ury 0\\$4
11 .\}
13 .de PSPIC
14 .br
15 .sy echo .ps-bb `psbb \\$1` >/tmp/psbb\\n[$$]
16 .so /tmp/psbb\\n[$$]
17 .if \\n[ps-nargs]=4 \{\
18 .       nr ps-wid (\\n[ps-urx]-\\n[ps-llx])
19 .       nr ps-ht (\\n[ps-ury]-\\n[ps-lly])
20 .       if \\n[ps-wid]<0 .nr ps-wid 0-\\n[ps-wid]
21 .       if \\n[ps-ht]<0 .nr ps-ht 0-\\n[ps-ht]
22 .       ie \\n[.$]>=2 .nr ps-deswid (i;\\$2)
23 .       el .nr ps-deswid \\n[.l]-\\n[.i]<?\\n[ps-wid]p
24 .       ie \\n[.$]>=3 .nr ps-desht (i;\\$3)
25 .       el .nr ps-desht \\n[ps-deswid]*1000+(\\n[ps-wid]/2)/\\n[ps-wid]\
26 *\\n[ps-ht]+500/1000
27 .       ne \\n[ps-desht]u+1v
28 .       nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
29 .       ie \\n[.$]>=3 .ds ps-desht \\n[ps-desht]
30 .       el .ds ps-desht \" empty
31 \h'\\n[ps-offset]u'\
32 \X'ps: invis'\
33 \Z'\D'p 0 \\n[ps-desht]u \\n[ps-deswid]u 0 0 -\\n[ps-desht]u''\
34 \X'ps: endinvis'\
35 \v'\\n[ps-desht]u'\X'ps: import \\$1 \
36 \\n[ps-llx] \\n[ps-lly] \\n[ps-urx] \\n[ps-ury] \\n[ps-deswid] \\*[ps-desht]'
37 .       br
38 .       sp \\n[ps-desht]u
39 .\}
40 .sy rm /tmp/psbb\\n[$$]