Guest User

Untitled

a guest
Jul 19th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. %!PS-Adobe-3.0
  2. %%BoundingBox 80 210 510 590
  3. %%Title: (The Laughing Man logo)
  4. %%Creator: (Marek Kubica <marek@xivilization.net>)
  5. %%EndComments
  6.  
  7. % blue
  8. /Fgcolor { [ 0 75 115 ] { 255 div } forall } def
  9. % white
  10. /Bgcolor { 1 1 1 } def
  11.  
  12. % code from PostScript language tutorial and cookbook, 1985
  13. % page 167-170
  14. /outsidecircletext
  15. {
  16. circtextdict begin
  17. /radius exch def
  18. /centerangle exch def
  19. /ptsize exch def
  20. /str exch def
  21. /xradius radius ptsize 4 div add def
  22.  
  23. gsave
  24. centerangle str findhalfangle add rotate
  25.  
  26. str
  27. {
  28. /charcode exch def
  29. ( ) dup 0 charcode put outsideplacechar
  30. } forall
  31. grestore
  32. end
  33. } def
  34.  
  35. /circtextdict 16 dict def
  36. circtextdict begin
  37. /findhalfangle
  38. {
  39. stringwidth pop 2 div
  40. 2 xradius mul pi mul div 360 mul
  41. } def
  42.  
  43. /outsideplacechar
  44. {
  45. /char exch def
  46. /halfangle char findhalfangle def
  47. gsave
  48. halfangle neg rotate
  49. radius 0 translate
  50. -90 rotate
  51. char stringwidth pop 2 div neg 0 moveto
  52. char show
  53. grestore
  54. halfangle 2 mul neg rotate
  55. } def
  56.  
  57. /pi 3.1415923 def
  58. end
  59. % end of the code from the blue book
  60.  
  61. % (angle -- )
  62. /angletext
  63. {
  64. /fontsize 28 def
  65. /Helvetica-Bold findfont fontsize scalefont setfont
  66.  
  67. % the text to display
  68. (I thought what I'd do was, I'd pretend I was one of those deaf-mutes)
  69. fontsize
  70. % roll the angle to the top
  71. 3 -1 roll
  72. % the radius of the circle
  73. 140
  74. % draw it
  75. outsidecircletext
  76. } def
  77.  
  78. % (radius line-width -- )
  79. /filledcircle
  80. {
  81. /width exch def
  82. /radius exch def
  83.  
  84. newpath
  85. 0 0 radius 0 360 arc
  86. 0 0 radius width sub 0 360 arc
  87. eofill
  88. } def
  89.  
  90. % ( -- )
  91. /innercircle
  92. {
  93. /radius 120 def
  94. 0 0 radius 10 170 arc
  95. 310 0 rlineto
  96. 200 -5 26 90 270 arcn
  97. -93 0 rlineto
  98. 0 0 radius 345 180 arcn
  99. stroke
  100. } def
  101.  
  102. % ( -- )
  103. /smile
  104. {
  105. /radius 80 def
  106. /offset 22 def
  107. 0 0 radius 180 offset add 360 offset sub arc
  108. closepath
  109. stroke
  110. } def
  111.  
  112. % ( -- )
  113. /smileeye
  114. {
  115. /startx 0 def
  116. /starty 0 def
  117. /endx 30 def
  118. /endy 0 def
  119.  
  120. /midx startx endx add 2 div def
  121.  
  122. 0 0 moveto
  123. startx starty midx 30 endx endy curveto
  124. endx endy midx 15 startx starty curveto
  125. closepath
  126. fill
  127. } def
  128.  
  129. % ( -- )
  130. /block
  131. {
  132. 0 126 moveto
  133. 0 10 rlineto
  134. stroke
  135. } def
  136.  
  137. % ( -- )
  138. /whiteout
  139. {
  140. gsave
  141. Bgcolor setrgbcolor
  142. 110 -25 100 40 rectfill
  143. grestore
  144. } def
  145.  
  146. % ( angle -- )
  147. /angleman
  148. {
  149. Fgcolor setrgbcolor
  150. % consumes the angle parameter
  151. angletext
  152. 180 11 filledcircle
  153. whiteout
  154. gsave
  155. 20 setlinewidth
  156. innercircle
  157. block
  158. smile
  159. grestore
  160.  
  161. gsave
  162. -60 -13 translate
  163. 1.5 1.5 scale
  164. smileeye
  165. 50 0 translate
  166. smileeye
  167. grestore
  168. } def
  169.  
  170. /laughingman
  171. {
  172. 270 400 translate
  173. 0 0 moveto
  174. 315 angleman
  175. } def
  176.  
  177. /rotatingman
  178. {
  179. [ 360 -1 1 { 315 add 360 mod } for ]
  180. {
  181. 270 400 translate
  182. 0 0 moveto
  183. angleman
  184. showpage
  185. } forall
  186. } def
  187.  
  188. %laughingman
  189. rotatingman
Add Comment
Please, Sign In to add comment