home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / groff / macros / tmac.psfig < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.2 KB  |  87 lines

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