home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / DOC / TR.FIG / s8 < prev    next >
Text File  |  1994-01-25  |  12KB  |  485 lines

  1. @Section
  2.    @Title { A Concise Reference for Fig }
  3. @Begin
  4. @PP
  5. The options to the @Code "@Fig" symbol, and their
  6. default values, are as follows.  The complete range of options is shown
  7. at right:
  8. @ID @Tab
  9.   hmargin { 1s }
  10.   vmargin { 0.5vx }
  11.   @Fmth { @Col @Code A ! @Col @Code " " ! @Col @Code B ! @Col @Code " " !
  12.       @Col 1.0c @Wide ! @Col C }
  13.   @Fmta { @Col @Code A ! @Col @Code "{" ! @Col @Code B ! @Col @Code "}" !
  14.       @Col 1.0c @Wide ! @Col C }
  15. {
  16. @Rowh
  17.   A { "@Fig" }
  18. @Rowa
  19.   A { "   maxlabels" }
  20.   B { 200 }
  21.   C { any whole number }
  22. @Rowa
  23.   A { "   linestyle" }
  24.   B { solid }
  25.   C { @Code "solid dashed cdashed dotted noline" }
  26. @Rowa
  27.   A { "   linewidth" }
  28.   B { 0.5 pt }
  29.   C { any Fig length (see below) }
  30. @Rowa
  31.   A { "   linecap"   }
  32.   B { round  }
  33.   C { @Code "butt round project" }
  34. @Rowa
  35.   A { "   dashlength"}
  36.   B { 0.15 cm }
  37.   C { any Fig length }
  38. @Rowa
  39.   A { "   paint"     }
  40.   B { nopaint }
  41.   C { @Code "nopaint white light grey gray dark black" }
  42. @Rowa
  43.   A { "   margin"    }
  44.   B { 0.4c }
  45.   C { any Lout length }
  46. @Rowa
  47.   A { "   arrow"     }
  48.   B { noarrow }
  49.   C { @Code "noarrow forward back both" }
  50. @Rowa
  51.   A { "   headstyle" }
  52.   B { open }
  53.   C { @Code "open halfopen closed" }
  54. @Rowa
  55.   A { "   headwidth" }
  56.   B { 0.05 cm }
  57.   C { any Fig length }
  58. @Rowa
  59.   A { "   headlength"}
  60.   B { 0.15 cm }
  61.   C { any Fig length }
  62. }
  63. The @Code "linecap" option determines the shape of the ends of lines:
  64. @Code "round" puts a round cap on them, which is the most useful in
  65. Fig;  @Code "butt" is a square end; and @Code "project" is a square end
  66. projecting half a line width past the end of the line; it is useful for
  67. getting sharp corners on rectangles and square dots in dotted lines.
  68. @FootNote {
  69. The line joining options of PostScript are not reflected in Fig options
  70. because Fig strokes paths segment by segment, not all at once, and so
  71. there are no line joins in the PostScript sense.  This was done to
  72. improve the appearance of dashed and dotted lines.
  73. }
  74. @PP
  75. The following standard shapes take the same options as {@Code "@Fig"},
  76. except that they do not have @Code "maxlabels" or the last four
  77. (arrow-drawing) options,
  78. and occasionally they have other options.  In most cases the default
  79. values of these options are taken from the enclosing {@Code "@Fig"}.
  80. Where there are extra options, or where a different default value is
  81. used, the option and its default value are shown.  The list also shows
  82. the shape's labels, and how it is superimposed on its right parameter
  83. (shown as a grey rectangle).  A larger margin will enlarge the right
  84. parameter and hence the shape as well.  Squares, polygons and circles
  85. have a diameter equal to the larger of @Code xsize and {@Code ysize}.
  86. @LP
  87. @ID {
  88. 5c @Wide @Code "@Box"
  89. ||7ct
  90. @Fig {
  91. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  92. linestyle { noline }  margin { 0c }
  93. @Box margin { 0c }
  94. { 2c @Wide 1c @High }
  95. // @ShowLabels
  96. }
  97. }
  98.  
  99. @LP
  100. @ID {
  101. 5c @Wide @Code "@Square"
  102. ||7ct
  103. @Fig {
  104. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  105. linestyle { noline }  margin { 0c }
  106. @Square margin { 0c }
  107. { 2c @Wide 1c @High }
  108. // @ShowLabels
  109. }
  110. }
  111. @LP
  112.  
  113. @ID {
  114. 5c @Wide @Code "@Diamond"
  115. ||7ct
  116. @Fig {
  117. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  118. linestyle { noline }  margin { 0c }
  119. @Diamond margin { 0c }
  120. { 2c @Wide 1c @High }
  121. // @ShowLabels
  122. }
  123. }
  124.  
  125. @LP
  126. @ID {
  127. 5c @Wide @Code {
  128. "@Polygon"
  129. "   sides { 3 }"
  130. "   angle { 180/sides }"
  131. }
  132. ||7ct
  133. @Fig {
  134. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  135. linestyle { noline }  margin { 0c }
  136. @Polygon margin { 0c }
  137. { 2c @Wide 1c @High }
  138. || @ShowLabels ||0.5c ... ||0.5c
  139. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  140. linestyle { noline }  margin { 0c }
  141. @Polygon sides { 12 } margin { 0c }
  142. { 2c @Wide 1c @High }
  143. ||1c ...
  144. // @ShowLabels
  145. }
  146. }
  147.  
  148. @ID {
  149. 5c @Wide @Code "@Ellipse"
  150. ||7ct
  151. @Fig {
  152. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  153. linestyle { noline }  margin { 0c }
  154. @Ellipse margin { 0c }
  155. { 2c @Wide 1c @High }
  156. // @ShowLabels
  157. }
  158. }
  159.  
  160. @LP
  161. @ID {
  162. 5c @Wide @Code "@Circle"
  163. ||7ct
  164. @Fig {
  165. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  166. linestyle { noline }  margin { 0c }
  167. @Circle margin { 0c }
  168. { 2c @Wide 1c @High }
  169. // @ShowLabels
  170. }
  171. }
  172. @LP
  173.  
  174. The following standard shapes have the same options as
  175. {@Code "@Fig"}, including the four arrow-drawing options,
  176. and occasionally they have others.  In each case the only difference
  177. between the line and arrow symbols is the default value of
  178. {@Code "arrow"}, which lines take from {@Code "@Fig"} and arrows set
  179. to {@Code "forward"}.  The first four draw a line along the mark of the
  180. right parameter, which is not necessarily the same as its left or top
  181. edge.
  182. @LP
  183. @ID {
  184. 5c @Wide @Code {
  185. "@HLine"
  186. "   margin { 0c }"
  187. }
  188. ||7ct
  189. @Fig {
  190. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  191. linestyle { noline }  margin { 0c }
  192. @HLine
  193. { 2c @Wide 1c @High }
  194. // @ShowLabels
  195. }
  196. }
  197.  
  198. @ID {
  199. 5c @Wide @Code {
  200. "@HArrow"
  201. "   margin { 0c }"
  202. "   arrow { forward }"
  203. }
  204. ||7ct
  205. @Fig {
  206. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  207. linestyle { noline }  margin { 0c }
  208. @HArrow
  209. { 2c @Wide 1c @High }
  210. // @ShowLabels
  211. }
  212. }
  213.  
  214. @ID {
  215. 5c @Wide @Code {
  216. "@VLine"
  217. "   margin { 0c }"
  218. }
  219. ||7ct
  220. @Fig {
  221. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  222. linestyle { noline }  margin { 0c }
  223. @VLine
  224. { 2c @Wide 1c @High }
  225. // @ShowLabels
  226. }
  227. }
  228.  
  229. @ID {
  230. 5c @Wide @Code {
  231. "@VArrow"
  232. "   margin { 0c }"
  233. "   arrow { forward }"
  234. }
  235. ||7ct
  236. @Fig {
  237. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  238. linestyle { noline }  margin { 0c }
  239. @VArrow
  240. { 2c @Wide 1c @High }
  241. // @ShowLabels
  242. }
  243. }
  244.  
  245. @ID {
  246. 5c @Wide @Code {
  247. "@Line"
  248. "   from { 0 ysize }"
  249. "   to { xsize 0 }"
  250. "   margin { 0c }"
  251. }
  252. ||7ct
  253. @Fig {
  254. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  255. linestyle { noline }  margin { 0c }
  256. @Line
  257. { 2c @Wide 1c @High }
  258. // @ShowLabels
  259. }
  260. }
  261.  
  262. @ID {
  263. 5c @Wide @Code {
  264. "@Arrow"
  265. "   from { 0 ysize }"
  266. "   to { xsize 0 }"
  267. "   margin { 0c }"
  268. "   arrow { forward }"
  269. }
  270. ||7ct
  271. @Fig {
  272. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  273. linestyle { noline }  margin { 0c }
  274. @Arrow
  275. { 2c @Wide 1c @High }
  276. // @ShowLabels
  277. }
  278. }
  279.  
  280. @ID {
  281. 5c @Wide @Code {
  282. "@Arc"
  283. "   from { 0 ysize }"
  284. "   to { xsize 0 }"
  285. "   ctr { 0 0 }"
  286. "   direction { clockwise }"
  287. "   margin { 0c }"
  288. }
  289. ||7ct
  290. @Fig {
  291. @Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  292. linestyle { noline }  margin { 0c }
  293. @Arc
  294. { 2c @Wide 1c @High }
  295. // @ShowLabels
  296. }
  297. }
  298.  
  299. More generally, the @Code "@Figure" symbol takes all the options of
  300. @Code "@Fig" except {@Code "maxlabels"}, together with a @Code shape
  301. option containing a sequence of points, and it connects each pair of
  302. points by a line or curve as specified by the following:
  303. @ID @Tab
  304.    vmargin { 0.5vx }
  305.    @Fmta { @Col A ! @Col B }
  306. {
  307. @Rowa
  308.   A { @I { point  point } }
  309.   B { Straight line }
  310. @Rowa
  311.   A { @I { point } @Code "[" &0.5s @Code "]" @I { point } }
  312.   B { Draw nothing }
  313. @Rowa
  314.   A { @I { point } @Code "[" @I point @Code "]" @I { point } }
  315.   B { Anticlockwise circular or elliptical arc }
  316. @Rowa
  317.   A { @I { point } @Code "[" @I point @Code "clockwise ]" @I { point } }
  318.   B { Clockwise circular or elliptical arc }
  319. @Rowa
  320.   A { @I { point } @Code "[" @I {point point} @Code "]" @I { point } }
  321.   B { Bezier curve with two control points }
  322. }
  323. @LP
  324. The remaining symbols do not draw shapes.  They are
  325. @ID lines @Break {
  326. @I colour  @Code "@Colour"  @I object
  327. @I colour  @Code "@Color"  @I object
  328. }
  329. Print @I object in {@I colour}, which may be {@Code "white"},
  330. {@Code "grey"}, {@Code "gray"}, {@Code "black"}, {@Code "red"},
  331. {@Code "green"}, or {@Code "blue"} at least.
  332. @ID lines @Break {
  333. @Code "{" @I {number number number} @Code "} @RGBColour"  @I object
  334. @Code "{" @I {number number number} @Code "} @RGBColor"  @I object
  335. @Code "{" @I {number number number} @Code "} @HSBColour"  @I object
  336. @Code "{" @I {number number number} @Code "} @HSBColor"  @I object
  337. }
  338. Print @I object in the colour defined by the three numbers, using the
  339. red-green-blue or hue-saturation-brightness colour models.
  340. @ID {
  341. @I point  @Code "@Label"  @I label
  342. }
  343. Within a shape, makes @I label stand for the point on the page denoted
  344. by {@I point}, which is not made part of the shape.  The label applies
  345. from here onwards until some other point is given this label, a
  346. relabelling occurs, or the figure ends.
  347. @ID {
  348. @I label  @Code "::"  @I object
  349. }
  350. Relabel every labelled point in the right parameter (which may be an
  351. arbitrary Lout object), by adding {@I label}{@Code "@"} to the front of
  352. each label.
  353. @ID {
  354. @Code "@Frame"  @I object
  355. }
  356. Equivalent to @Code "@Figure shape {xsize 0 @Label X 0 ysize @Label Y}"
  357. @I object & .
  358. @ID {
  359. @I point  @Code "@BaseOf"  @I object
  360. }
  361. Translate @I object so that its bottom left-hand corner appears at
  362. {@I point}.  Lout thinks that the result is an empty object.
  363. @ID {
  364. @I point  @Code "@MarkOf"  @I object
  365. }
  366. Translate @I object so that the point where its marks cross appears at
  367. {@I point}.  Lout thinks that the result is an empty object.
  368. @ID {
  369. @Code "@ShowLabels"
  370. }
  371. Display all the labels of the figure created up to this point.
  372. @PP
  373. The following lists define all the ways to specify lengths, angles and
  374. points.
  375. @FootNote {
  376. A length is represented in PostScript by a single number on the operand
  377. stack; so is an angle.  A point is represented by two numbers on the
  378. stack.  Those familiar with PostScript and willing to sacrifice portability
  379. and increase their risk of error can therefore write, for example,
  380. @OneCol {@I length @Code "sqrt"} within a shape, to obtain a length which
  381. is the square root of another length, or @OneCol { @I point @Code "exch" }
  382. to obtain the reflection of a point about the main diagonal, and so on.
  383. }
  384. Brief explanations appear to the right, with the symbols' precedences in
  385. parentheses where appropriate.
  386. @DP
  387. @Tab
  388.   vmargin { 0.5vx }
  389.   @Fmth { @Col { &@DispIndent     A } ! @Col   }
  390.   @Fmta { @Col { &@DispIndent &2s A } ! @Col B }
  391. {
  392. @Rowh A { @I length } vmargin { 0.2vx }
  393. @Rowh
  394. @Rowa
  395.   A { 0 }
  396.   B { zero }
  397. @Rowa
  398.   A { @Code xmark }
  399.   B { distance to column mark }
  400. @Rowa
  401.   A { @Code ymark }
  402.   B { distance to row mark }
  403. @Rowa
  404.   A { @Code xsize }
  405.   B { distance to right boundary }
  406. @Rowa
  407.   A { @Code ysize }
  408.   B { distance to top boundary }
  409. @Rowa
  410.   A { @I number @Code in }
  411.   B { @I number inches (39) }
  412. @Rowa
  413.   A { @I number @Code cm }
  414.   B { @I number centimetres (39) }
  415. @Rowa
  416.   A { @I number @Code pt }
  417.   B { @I number points (39) }
  418. @Rowa
  419.   A { @I number @Code em }
  420.   B { @I number ems (39) }
  421. @Rowa
  422.   A { @I number @Code sp }
  423.   B { 1 sp is the current width of a space (39) }
  424. @Rowa
  425.   A { @I number @Code vs }
  426.   B { 1 vs is the current inter-line space (39) }
  427. @Rowa
  428.   A { @I number @Code ft }
  429.   B { 1 ft is the size of the current font (39) }
  430. @Rowa
  431.   A { @I point @Code "@Distance" @I point }
  432.   B { distance between two points (35) }
  433. @Rowa
  434.   A { @I point @Code "@XDistance" @I point }
  435.   B { horizontal distance between two points (35) }
  436. @Rowa
  437.   A { @I point @Code "@YDistance" @I point }
  438.   B { vertical distance between two points (35) }
  439. @Rowh
  440. @Rowh
  441. @Rowh A { @I angle } vmargin { 0.2vx }
  442. @Rowh
  443. @Rowa
  444.   A { @I number @Code dg }
  445.   B { @I number degrees (39) }
  446. @Rowa
  447.   A { @I number }
  448.   B { @I number degrees (@Code dg is optional) }
  449. @Rowa
  450.   A { @I point @Code "@Angle" @I point }
  451.   B { angle from first point to second (35) }
  452. @Rowh
  453. @Rowh
  454. @Rowh A { @I point } vmargin { 0.2vx }
  455. @Rowh
  456. @Rowa
  457.   A { @I {length  length} }
  458.   B { @I x and @I y distance from origin (5) }
  459. @Rowa
  460.   A { @I length  @Code "<<"  @I angle }
  461.   B { distance and angle from origin (38) }
  462. @Rowa
  463.   A { @I point  @Code "++"  @I point }
  464.   B { vector sum of two points (36) }
  465. @Rowa
  466.   A { @I point  @Code "--"  @I point }
  467.   B { vector difference of two points (36) }
  468. @Rowa
  469.   A { @I point  @Code "@Max"  @I point }
  470.   B { vector maximum of two points (36) }
  471. @Rowa
  472.   A { @I point  @Code "@Min"  @I point }
  473.   B { vector minimum of two points (36) }
  474. @Rowa
  475.   A { @I point  @Code "**"  @I number }
  476.   B { multiplication of point by number (37) }
  477. @Rowa
  478.   A { @I label }
  479.   B {  a previously defined label }
  480. @Rowa
  481.   A { @Code "@Prev"     }
  482.   B {  the previous point in a shape }
  483. }
  484. @End @Section
  485.