Remove no longer needed catman periodic via 'make upgrade'.
[dragonfly.git] / contrib / groff / src / preproc / grn / grn.man
1 '\" t
2 .ig
3 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2009
4   Free Software Foundation, Inc.
5
6 Permission is granted to make and distribute verbatim copies of
7 this manual provided the copyright notice and this permission notice
8 are preserved on all copies.
9
10 Permission is granted to copy and distribute modified versions of this
11 manual under the conditions for verbatim copying, provided that the
12 entire resulting derived work is distributed under the terms of a
13 permission notice identical to this one.
14
15 Permission is granted to copy and distribute translations of this
16 manual into another language, under the above conditions for modified
17 versions, except that this permission notice may be included in
18 translations approved by the Free Software Foundation instead of in
19 the original English.
20 ..
21 .
22 .do nr grn_C \n[.C]
23 .cp 0
24 .
25 .de TQ
26 .  br
27 .  ns
28 .  TP \\$1
29 ..
30 .
31 .\" Like TP, but if specified indent is more than half
32 .\" the current line-length - indent, use the default indent.
33 .de Tp
34 .  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
35 .  el .TP "\\$1"
36 ..
37 .
38 .
39 .TH @G@GRN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
40 .SH NAME
41 @g@grn \- groff preprocessor for gremlin files
42 .SH SYNOPSIS
43 .BR @g@grn
44 [
45 .B \-Cv
46 ]
47 [
48 .BI \-T dev
49 ]
50 [
51 .BI \-M dir
52 ]
53 [
54 .BI \-F dir
55 ]
56 [
57 .IR file\.\.\.\&
58 ]
59 .PP
60 It is possible to have whitespace between a command line option and its
61 parameter.
62 .SH DESCRIPTION
63 .I @g@grn
64 is a preprocessor for including
65 .I gremlin
66 pictures in
67 .I groff
68 input.
69 .I @g@grn
70 writes to standard output, processing only input lines between two that
71 start with
72 .B .GS
73 and
74 .BR .GE.
75 Those lines must contain
76 .I @g@grn
77 commands (see below).
78 These commands request a
79 .I gremlin
80 file, and the picture in that file is
81 converted and placed in the
82 .I @g@troff
83 input stream.
84 The
85 .B .GS
86 request may be followed by a C, L, or R to center, left, or right
87 justify the whole
88 .I gremlin
89 picture (default justification is center).
90 If no
91 .I file
92 is mentioned, the standard input is read.
93 At the end of the picture, the position on the page is the bottom of the
94 .I gremlin
95 picture.
96 If the
97 .I @g@grn
98 entry is ended with
99 .B .GF
100 instead of
101 .BR .GE ,
102 the position is left at the top of the picture.
103 .PP
104 Please note that currently only the \-me macro package has support for
105 .BR .GS ,
106 .BR .GE ,
107 and
108 .BR .GF .
109 .PP
110 The following command-line options are understood:
111 .TP
112 .BI \-T dev
113 Prepare output for printer
114 .IR dev .
115 The default device is
116 .BR @DEVICE@ .
117 See
118 .BR groff (@MAN1EXT@)
119 for acceptable devices.
120 .TP
121 .BI \-M dir
122 Prepend
123 .I dir
124 to the default search path for
125 .I gremlin
126 files.
127 The default path is (in that order) the current directory, the home
128 directory,
129 .BR @SYSTEMMACRODIR@ ,
130 .BR @LOCALMACRODIR@ ,
131 and
132 .BR @MACRODIR@ .
133 .TP
134 .BI \-F dir
135 Search
136 .I dir
137 for subdirectories
138 .BI dev name
139 .RI ( name
140 is the name of the device) for the
141 .B DESC
142 file before the default font directories
143 .BR @LOCALFONTDIR@ ,
144 .BR @FONTDIR@ ,
145 and
146 .BR @LEGACYFONTDIR@ .
147 .TP
148 .B \-C
149 Recognize
150 .B .GS
151 and
152 .B .GE
153 (and
154 .BR .GF )
155 even when followed by a character other than space or newline.
156 .\".TP
157 .\".B \-s
158 .\"This switch causes the picture to be traversed twice:
159 .\"The first time, only the interiors of filled polygons (as borderless
160 .\"polygons) are printed.
161 .\"The second time, the outline is printed as a series of line segments.
162 .\"This way, postprocessors that overwrite rather than merge picture elements
163 .\"(such as Postscript) can still have text and graphics on a shaded
164 .\"background.
165 .TP
166 .B \-v
167 Print the version number.
168 .SH GRN COMMANDS
169 Each input line between
170 .B .GS
171 and
172 .B .GE
173 may have one
174 .I @g@grn
175 command.
176 Commands consist of one or two strings separated by white space, the first
177 string being the command and the second its operand.
178 Commands may be upper or lower case and abbreviated down to one character.
179 .PP
180 Commands that affect a picture's environment (those listed before
181 .BR default ,
182 see below) are only in effect for the current picture:
183 The environment is reinitialized to the defaults at the start of the next
184 picture.
185 The commands are as follows:
186 .TP
187 .BI 1\  N
188 .TQ
189 .BI 2\  N
190 .TQ
191 .BI 3\  N
192 .TQ
193 .BI 4\  N
194 Set
195 .IR gremlin 's
196 text size number 1 (2, 3, or 4) to
197 .I N
198 points.
199 The default is 12 (16, 24, and 36, respectively).
200 .TP
201 .BI roman\  f
202 .TQ
203 .BI italics\  f
204 .TQ
205 .BI bold\  f
206 .TQ
207 .BI special\  f
208 Set the roman (italics, bold, or special) font to
209 .IR @g@troff 's
210 font
211 .I f
212 (either a name or number).
213 The default is R (I, B, and S, respectively).
214 .TP
215 .BI l\  f
216 .TQ
217 .BI stipple\  f
218 Set the stipple font to
219 .IR @g@troff 's
220 stipple font
221 .I f
222 (name or number).
223 The command
224 .B stipple
225 may be abbreviated down as far as `st' (to avoid
226 confusion with
227 .BR special ).
228 There is
229 .I no
230 default for stipples (unless one is set by the default command), and it is
231 invalid to include a
232 .I gremlin
233 picture with polygons without specifying a
234 stipple font.
235 .TP
236 .BI x\  N
237 .TQ
238 .BI scale\  N
239 Magnify the picture (in addition to any default magnification) by
240 .IR N ,
241 a floating point number larger than zero.
242 The command
243 .B scale
244 may be abbreviated down to `sc'.
245 .TP
246 .BI narrow\  N
247 .TQ
248 .BI medium\  N
249 .TQ
250 .BI thick\  N
251 Set the thickness of
252 .IR gremlin 's
253 narrow (medium and thick, respectively) lines to
254 .I N
255 times 0.15pt (this value can be changed at compile time).
256 The default is 1.0 (3.0 and 5.0, respectively), which corresponds to 0.15pt
257 (0.45pt and 0.75pt, respectively).
258 A thickness value of zero selects the smallest available line thickness.
259 Negative values cause the line thickness to be proportional to the current
260 point size.
261 .TP
262 .BI pointscale\  <off/on>
263 Scale text to match the picture.
264 Gremlin text is usually printed in the point size specified with the
265 commands
266 .BR 1 ,
267 .BR 2 ,
268 .BR 3 ,
269 .RB or\~ 4 ,
270 regardless of any scaling factors in the picture.
271 Setting
272 .B pointscale
273 will cause the point sizes to scale with the picture (within
274 .IR @g@troff 's
275 limitations, of course).
276 An operand of anything but
277 .I off
278 will turn text scaling on.
279 .TP
280 .B default
281 Reset the picture environment defaults to the settings in the current
282 picture.
283 This is meant to be used as a global parameter setting mechanism at the
284 beginning of the
285 .I @g@troff
286 input file, but can be used at any time to reset the
287 default settings.
288 .TP
289 .BI width\  N
290 Forces the picture to be
291 .I N
292 inches wide.
293 This overrides any scaling factors present in the same picture.
294 .RB ` width
295 .IR 0 '
296 is ignored.
297 .TP
298 .BI height\  N
299 Forces picture to be
300 .I N
301 inches high, overriding other scaling factors.
302 If both `width' and `height' are specified the tighter constraint will
303 determine the scale of the picture.
304 .B Height
305 and
306 .B width
307 commands are not saved with a
308 .B default
309 command.
310 They will, however, affect point size scaling if that option is set.
311 .TP
312 .BI file\  name
313 Get picture from
314 .I gremlin
315 file
316 .I name
317 located the current directory (or in the library directory; see the
318 .B \-M
319 option above).
320 If two
321 .B file
322 commands are given, the second one overrides the first.
323 If
324 .I name
325 doesn't exist, an error message is reported and processing continues from
326 the
327 .B .GE
328 line.
329 .SH NOTES ABOUT GROFF
330 Since
331 .I @g@grn
332 is a preprocessor, it doesn't know about current indents, point sizes,
333 margins, number registers, etc.
334 Consequently, no
335 .I @g@troff
336 input can be placed between the
337 .B .GS
338 and
339 .B .GE
340 requests.
341 However,
342 .I gremlin
343 text is now processed by
344 .IR @g@troff ,
345 so anything valid in a single line of
346 .I @g@troff
347 input is valid in a line of
348 .I gremlin
349 text (barring `.' directives at the beginning of a line).
350 Thus, it is possible to have equations within a
351 .I gremlin
352 figure by including in the
353 .I gremlin
354 file
355 .I eqn
356 expressions enclosed by previously defined delimiters (e.g.
357 .IR $$ ).
358 .PP
359 When using
360 .I @g@grn
361 along with other preprocessors, it is best to run
362 .I tbl
363 before
364 .IR @g@grn ,
365 .IR pic ,
366 and/or
367 .I ideal
368 to avoid overworking
369 .IR tbl .
370 .I Eqn
371 should always be run last.
372 .PP
373 A picture is considered an entity, but that doesn't stop
374 .I @g@troff
375 from trying to break it up if it falls off the end of a page.
376 Placing the picture between `keeps' in \-me macros will ensure proper
377 placement.
378 .PP
379 .I @g@grn
380 uses
381 .IR @g@troff 's 
382 number registers
383 .B g1
384 through
385 .B g9
386 and sets registers
387 .B g1
388 and
389 .B g2
390 to the width and height of the
391 .I gremlin
392 figure (in device units) before entering the
393 .B .GS
394 request (this is for those who want to rewrite these macros).
395 .SH GREMLIN FILE FORMAT
396 There exist two distinct 
397 .I gremlin
398 file formats, the original format from the
399 .I AED
400 graphic terminal version, and the
401 .I SUN
402 or
403 .I X11
404 version.
405 An extension to the
406 .IR SUN / X11
407 version allowing reference points with negative coordinates is
408 .B not
409 compatible with the
410 .I AED
411 version.
412 As long as a 
413 .I gremlin
414 file does not contain negative coordinates, either format will be read
415 correctly by either version of
416 .I gremlin
417 or
418 .IR @g@grn .
419 The other difference to the
420 .IR SUN / X11
421 format is the use of names for picture objects (e.g., POLYGON, CURVE)
422 instead of numbers.
423 Files representing the same picture are shown in Table 1 in each format.
424 .sp
425 .TS
426 center, tab(@);
427 l lw(0.1i) l.
428 sungremlinfile@@gremlinfile
429 0 240.00 128.00@@0 240.00 128.00
430 CENTCENT@@2
431 240.00 128.00@@240.00 128.00
432 185.00 120.00@@185.00 120.00
433 240.00 120.00@@240.00 120.00
434 296.00 120.00@@296.00 120.00
435 *@@-1.00 -1.00
436 2 3@@2 3
437 10 A Triangle@@10 A Triangle
438 POLYGON@@6
439 224.00 416.00@@224.00 416.00
440 96.00 160.00@@96.00 160.00
441 384.00 160.00@@384.00 160.00
442 *@@-1.00 -1.00
443 5 1@@5 1
444 0@@0
445 -1@@-1
446 .T&
447 css.
448 .sp
449 Table 1. File examples
450 .TE
451 .sp
452 .IP \(bu
453 The first line of each
454 .I gremlin
455 file contains either the string
456 .B gremlinfile
457 .RI ( AED
458 version) or
459 .B sungremlinfile
460 .RI ( SUN / X11 )
461 .IP \(bu
462 The second line of the file contains an orientation, and
463 .B x
464 and
465 .B y
466 values for a positioning point, separated by spaces.
467 The orientation, either
468 .B 0
469 or
470 .BR 1 ,
471 is ignored by the
472 .IR SUN / X11
473 version.
474 .B 0
475 means that
476 .I gremlin
477 will display things in horizontal format (drawing area wider than it is
478 tall, with menu across top).
479 .B 1
480 means that
481 .I gremlin
482 will display things in vertical format (drawing area taller than it is wide,
483 with menu on left side).
484 .B x
485 and
486 .B y
487 are floating point values giving a positioning point to be used when this
488 file is read into another file.
489 The stuff on this line really isn't all that important; a value of ``1 0.00
490 0.00'' is suggested.
491 .IP \(bu
492 The rest of the file consists of zero or more element specifications.
493 After the last element specification is a line containing the string ``-1''.
494 .IP \(bu
495 Lines longer than 127 characters are chopped to this limit.
496 .SH ELEMENT SPECIFICATIONS
497 .IP \(bu
498 The first line of each element contains a single decimal number giving the
499 type of the element
500 .RI ( AED
501 version) or its ASCII name
502 .RI ( SUN / X11
503 version).
504 See Table 2.
505 .sp
506 .TS
507 center, tab(@);
508 css
509 ccc
510 nll.
511 \fIgremlin\fP File Format \(mi Object Type Specification
512 .sp
513 \fIAED\fP Number@\fISUN\fP/\fIX11\fP Name@Description
514 0@BOTLEFT@bottom-left-justified text
515 1@BOTRIGHT@bottom-right-justified text
516 2@CENTCENT@center-justified text
517 3@VECTOR@vector
518 4@ARC@arc
519 5@CURVE@curve
520 6@POLYGON@polygon
521 7@BSPLINE@b-spline
522 8@BEZIER@B\['e]zier
523 10@TOPLEFT@top-left-justified text
524 11@TOPCENT@top-center-justified text
525 12@TOPRIGHT@top-right-justified text
526 13@CENTLEFT@left-center-justified text
527 14@CENTRIGHT@right-center-justified text
528 15@BOTCENT@bottom-center-justified text
529 .T&
530 css.
531 .sp
532 Table 2.
533 Type Specifications in \fIgremlin\fP Files
534 .TE
535 .sp
536 .IP \(bu
537 After the object type comes a variable number of lines, each specifying a
538 point used to display the element.
539 Each line contains an x-coordinate and a y-coordinate in floating point
540 format, separated by spaces.
541 The list of points is terminated by a line containing the string ``-1.0
542 -1.0''
543 .RI ( AED
544 version) or a single asterisk, ``*''
545 .RI ( SUN / X11
546 version).
547 .IP \(bu
548 After the points comes a line containing two decimal values, giving the
549 brush and size for the element.
550 The brush determines the style in which things are drawn.
551 For vectors, arcs, and curves there are six valid brush values:
552 .sp
553 .TS
554 center, tab(@);
555 ncw(0.1i)l.
556 1 \(mi@@thin dotted lines
557 2 \(mi@@thin dot-dashed lines
558 3 \(mi@@thick solid lines
559 4 \(mi@@thin dashed lines
560 5 \(mi@@thin solid lines
561 6 \(mi@@medium solid lines
562 .TE
563 .sp
564 For polygons, one more value, 0, is valid.
565 It specifies a polygon with an invisible border.
566 For text, the brush selects a font as follows:
567 .sp
568 .TS
569 center, tab(@);
570 ncw(0.1i)l.
571 1 \(mi@@roman (R font in groff)
572 2 \(mi@@italics (I font in groff)
573 3 \(mi@@bold (B font in groff)
574 4 \(mi@@special (S font in groff)
575 .TE
576 .sp
577 If you're using
578 .I @g@grn
579 to run your pictures through
580 .IR groff ,
581 the font is really just a starting font:
582 The text string can contain formatting sequences like
583 ``\efI''
584 or
585 ``\ed''
586 which may change the font (as well as do many other things).
587 For text, the size field is a decimal value between 1 and 4.
588 It selects the size of the font in which the text will be drawn.
589 For polygons, this size field is interpreted as a stipple number to fill the
590 polygon with.
591 The number is used to index into a stipple font at print time.
592 .IP \(bu
593 The last line of each element contains a decimal number and a string of
594 characters, separated by a single space.
595 The number is a count of the number of characters in the string.
596 This information is only used for text elements, and contains the text
597 string.
598 There can be spaces inside the text.
599 For arcs, curves, and vectors, this line of the element contains the string
600 ``0''.
601 .SH NOTES ON COORDINATES
602 .I gremlin
603 was designed for
604 .IR AED s,
605 and its coordinates reflect the
606 .I AED
607 coordinate space.
608 For vertical pictures, x-values range 116 to 511, and y-values from 0 to
609 483.
610 For horizontal pictures, x-values range from 0 to 511 and y-values range
611 from 0 to 367.
612 Although you needn't absolutely stick to this range, you'll get best results
613 if you at least stay in this vicinity.
614 Also, point lists are terminated by a point of (-1, -1), so you shouldn't
615 ever use negative coordinates.
616 .I gremlin
617 writes out coordinates using format ``%f1.2''; it's probably a good idea to
618 use the same format if you want to modify the
619 .I @g@grn
620 code.
621 .SH NOTES ON SUN/X11 COORDINATES
622 There is no longer a restriction on the range of coordinates used to create
623 objects in the
624 .IR SUN / X11
625 version of
626 .IR gremlin .
627 However, files with negative coordinates
628 .B will
629 cause problems if displayed on the
630 .IR AED .
631 .SH FILES
632 .Tp \w'@FONTDIR@/devname/DESC'u+3n
633 .BI @FONTDIR@/dev name /DESC
634 Device description file for device
635 .IR name .
636 .SH SEE ALSO
637 .BR gremlin (1),
638 .BR groff (@MAN1EXT@),
639 .BR @g@pic (@MAN1EXT@),
640 .BR ideal (1)
641 .SH HISTORY
642 .PP
643 David Slattengren and Barry Roitblat wrote the original Berkeley
644 .IR @g@grn .
645 .PP
646 Daniel Senderowicz and Werner Lemberg modified it for
647 .IR groff .
648 .
649 .cp \n[grn_C]
650 .
651 .\" Local Variables:
652 .\" mode: nroff
653 .\" End: