home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / GROFFEXE / LIB / GROFF / TMAC / PSPIC < prev    next >
Text File  |  1992-03-16  |  1KB  |  42 lines

  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. .\}
  12. ..
  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[$$]
  41. ..
  42.