Penguin
Annotated edit history of grn(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 GRN
2 !!!GRN
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 GRN COMMANDS
7 NOTES ABOUT GROFF
8 GREMLIN FILE FORMAT
9 ELEMENT SPECIFICATIONS
10 NOTES ON COORDINATES
11 NOTES ON SUN/X11 COORDINATES
12 FILES
13 SEE ALSO
14 HISTORY
15 ----
16 !!NAME
17
18
19 grn - groff preprocessor for gremlin files
20 !!SYNOPSIS
21
22
23 __grn__ [[ __-Cv__ ] [[ __-T__''dev'' ] [[
24 __-M__''dir'' ] [[ __-F__''dir'' ] [[
25 ''file...'' ]
26
27
28 It is possible to have whitespace between a command line
29 option and its parameter.
30 !!DESCRIPTION
31
32
33 ''grn'' is a preprocessor for including ''gremlin''
34 pictures in ''groff'' input. ''grn'' writes to
35 standard output, processing only input lines between two
36 that start with __.GS__ and __.GE.__ Those lines must
37 contain ''grn'' commands (see below). These commands
38 request a ''gremlin'' file, and the picture in that file
39 is converted and placed in the ''troff'' input stream.
40 The __.GS__ request may be followed by a C, L, or R to
41 center, left, or right justify the whole ''gremlin''
42 picture (default justification is center). If no ''file''
43 is mentioned, the standard input is read. At the end of the
44 picture, the position on the page is the bottom of the
45 ''gremlin'' picture. If the ''grn'' entry is ended
46 with __.GF__ instead of __.GE__, the position is left
47 at the top of the picture.
48
49
50 Please note that currently only the -me macro package has
51 support for __.GS__, __.GE__, and
52 __.GF__.
53
54
55 The following command-line options are
56 understood:
57
58
59 __-T__''dev''
60
61
62 Prepare output for printer ''dev''. The default device is
63 __ps__. See groff(1) for acceptable
64 devices.
65
66
67 __-M__''dir''
68
69
70 Prepend ''dir'' to the default search path for
71 ''gremlin'' files. The default path is (in that order)
72 the current directory, the home directory,
73 __/usr/lib/groff/site-tmac__,
74 __/usr/share/groff/site-tmac__, and
75 __/usr/share/groff/1.17.2/tmac__.
76
77
78 __-F__''dir''
79
80
81 Search ''dir'' for subdirectories __dev__''name''
82 (''name'' is the name of the device) for the __DESC__
83 file before the normal
84 __/usr/share/groff/1.17.2/font__.
85
86
87 __-C__
88
89
90 Recognize __.GS__ and __.GE__ (resp. __.GF__) even
91 when followed by a character other than space or
92 newline.
93
94
95 __-v__
96
97
98 Print the version number.
99 !!GRN COMMANDS
100
101
102 Each input line between __.GS__ and __.GE__ may have
103 one ''grn'' command. Commands consist of one or two
104 strings separated by white space, the first string being the
105 command and the second its operand. Commands may be upper or
106 lower case and abbreviated down to one
107 character.
108
109
110 Commands that affect a picture's environment (those listed
111 before __default__, see below) are only in effect for the
112 current picture: The environment is reinitialized to the
113 defaults at the start of the next picture. The commands are
114 as follows:
115
116
117 __1__ ''N''
118
119
120 __2__ ''N''
121
122
123 __3__ ''N''
124
125
126 __4__ ''N''
127
128
129 Set ''gremlin'''s text size number 1 (2, 3, or 4) to
130 ''N'' points. The default is 12 (resp. 16, 24, and
131 36).
132
133
134 __roman__ ''f''
135
136
137 __italics__ ''f''
138
139
140 __bold__ ''f''
141
142
143 __special__ ''f''
144
145
146 Set the roman (italics, bold, or special) font to
147 ''troff'''s font ''f'' (either a name or number). The
148 default is R (resp. I, B, and S).
149
150
151 __l__ ''f''
152
153
154 __stipple__ ''f''
155
156
157 Set the stipple font to ''troff'''s stipple font ''f''
158 (name or number). The command __stipple__ may be
159 abbreviated down as far as `st' (to avoid confusion with
160 __special__). There is ''no'' default for stipples
161 (unless one is set by the default command), and it is
162 illegal to include a ''gremlin'' picture with polygons
163 without specifying a stipple font.
164
165
166 __x__ ''N''
167
168
169 __scale__ ''N''
170
171
172 Magnify the picture (in addition to any default
173 magnification) by ''N'', a floating point number larger
174 than zero. The command __scale__ may be abbreviated down
175 to `sc'.
176
177
178 __narrow__ ''N''
179
180
181 __medium__ ''N''
182
183
184 __thick__ ''N''
185
186
187 Set the thickness of ''gremlin'''s narrow (resp. medium
188 and thick) lines to ''N'' times 0.15pt (this value can be
189 changed at compile time). The default is 1.0 (resp. 3.0 and
190 5.0), which corresponds to 0.15pt (resp. 0.45pt and 0.75pt).
191 A thickness value of zero selects the smallest available
192 line thickness. Negative values cause the line thickness to
193 be proportional to the current point size.
194
195
196 __pointscale__ ''''
197
198
199 Scale text to match the picture. Gremlin text is usually
200 printed in the point size specified with the commands
201 __1__, __2__, __3__, or __4__ regardless of any
202 scaling factors in the picture. Setting __pointscale__
203 will cause the point sizes to scale with the picture (within
204 ''troff'''s limitations, of course). An operand of
205 anything but ''off'' will turn text scaling
206 on.
207
208
209 __default__
210
211
212 Reset the picture environment defaults to the settings in
213 the current picture. This is meant to be used as a global
214 parameter setting mechanism at the beginning of the
215 ''troff'' input file, but can be used at any time to
216 reset the default settings.
217
218
219 __width__ ''N''
220
221
222 Forces the picture to be ''N'' inches wide. This
223 overrides any scaling factors present in the same picture.
224 `__width__ ''0''' is ignored.
225
226
227 __height__ ''N''
228
229
230 Forces picture to be ''N'' inches high, overriding other
231 scaling factors. If both `width' and `height' are specified
232 the tighter constraint will determine the scale of the
233 picture. __Height__ and __width__ commands are not
234 saved with a __default__ command. They will, however,
235 affect point size scaling if that option is
236 set.
237
238
239 __file__ ''name''
240
241
242 Get picture from ''gremlin'' file ''name'' located the
243 current directory (or in the library directory; see the
244 __-M__ option above). If two __file__ commands are
245 given, the second one overrides the first. If ''name''
246 doesn't exist, an error message is reported and processing
247 continues from the __.GE__ line.
248 !!NOTES ABOUT GROFF
249
250
251 Since ''grn'' is a preprocessor, it doesn't know about
252 current indents, point sizes, margins, number registers,
253 etc. Consequently, no ''troff'' input can be placed
254 between the __.GS__ and __.GE__ requests. However,
255 ''gremlin'' text is now processed by ''troff'', so
256 anything legal in a single line of ''troff'' input is
257 legal in a line of ''gremlin'' text (barring `.'
258 directives at the beginning of a line). Thus, it is possible
259 to have equations within a ''gremlin'' figure by
260 including in the ''gremlin'' file ''eqn'' expressions
261 enclosed by previously defined delimiters (e.g.
262 ''$$'').
263
264
265 When using ''grn'' along with other preprocessors, it is
266 best to run ''tbl'' before ''grn'', ''pic'', and/or
267 ''ideal'' to avoid overworking ''tbl''. ''Eqn''
268 should always be run last.
269
270
271 A picture is considered an entity, but that doesn't stop
272 ''troff'' from trying to break it up if it falls off the
273 end of a page. Placing the picture between `keeps' in -me
274 macros will ensure proper placement.
275
276
277 ''grn'' uses ''troff'''s number registers __g1__
278 through __g9__ and sets registers __g1__ and __g2__
279 to the width and height of the ''gremlin'' figure (in
280 device units) before entering the __.GS__ request (this
281 is for those who want to rewrite these macros).
282 !!GREMLIN FILE FORMAT
283
284
285 There exist two distinct ''gremlin'' file formats, the
286 original format from the ''AED'' graphic terminal
287 version, and the ''SUN'' or ''X11'' version. An
288 extension to the ''SUN''/''X11'' version allowing
289 reference points with negative coordinates is __not__
290 compatible with the ''AED'' version. As long as a
291 ''gremlin'' file does not contain negative coordinates,
292 either format will be read correctly by either version of
293 ''gremlin'' or ''grn''. The other difference to the
294 ''SUN''/''X11'' format is the use of names for picture
295 objects (e.g., POLYGON, CURVE) instead of numbers. Files
296 representing the same picture are shown in Table 1 in each
297 format.
298
299
300 The first line of each ''gremlin'' file contains either the string __gremlinfile__ (''AED'' version) or __sungremlinfile__ (''SUN''/''X11'')
301
302
303 The second line of the file contains an orientation, and
304 __x__ and __y__ values for a positioning point,
305 separated by spaces. The orientation, either __0__ or
306 __1__, is ignored by the ''SUN''/''X11'' version.
307 __0__ means that ''gremlin'' will display things in
308 horizontal format (drawing area wider than it is tall, with
309 menu across top). __1__ means that ''gremlin'' will
310 display things in vertical format (drawing area taller than
311 it is wide, with menu on left side). __x__ and __y__
312 are floating point values giving a positioning point to be
313 used when this file is read into another file. The stuff on
314 this line really isn't all that important; a value of ``1
315 0.00 0.00'' is suggested.
316
317
318 The rest of the file consists of zero or more element
319 specifications. After the last element specification is a
320 line containing the string ``-1''.
321
322
323 Lines longer than 127 characters are chopped to this
324 limit.
325 !!ELEMENT SPECIFICATIONS
326
327
328 The first line of each element contains a single decimal
329 number giving the type of the element (''AED'' version)
330 or its ASCII name (''SUN''/''X11'' version). See Table
331 2.
332
333
334 After the object type comes a variable number of lines, each specifying a point used to display the element. Each line contains an x-coordinate and a y-coordinate in floating point format, separated by spaces. The list of points is terminated by a line containing the string ``-1.0 -1.0'' (''AED'' version) or a single asterisk, ``*'' (''SUN''/''X11'' version).
335
336
337 After the points comes a line containing two decimal values,
338 giving the brush and size for the element. The brush
339 determines the style in which things are drawn. For vectors,
340 arcs, and curves there are six legal brush
341 values:
342
343
344 For polygons, one more value, 0, is legal. It specifies a polygon with an invisible border. For text, the brush selects a font as follows:
345
346
347 If you're using ''grn'' to run your pictures through ''groff'', the font is really just a starting font: The text string can contain formatting sequences like ``fI'' or ``d'' which may change the font (as well as do many other things). For text, the size field is a decimal value between 1 and 4. It selects the size of the font in which the text will be drawn. For polygons, this size field is interpreted as a stipple number to fill the polygon with. The number is used to index into a stipple font at print time.
348
349
350 The last line of each element contains a decimal number and
351 a string of characters, separated by a single space. The
352 number is a count of the number of characters in the string.
353 This information is only used for text elements, and
354 contains the text string. There can be spaces inside the
355 text. For arcs, curves, and vectors, this line of the
356 element contains the string ``0''.
357 !!NOTES ON COORDINATES
358
359
360 ''gremlin'' was designed for ''AED''s, and its
361 coordinates reflect the ''AED'' coordinate space. For
362 vertical pictures, x-values range 116 to 511, and y-values
363 from 0 to 483. For horizontal pictures, x-values range from
364 0 to 511 and y-values range from 0 to 367. Although you
365 needn't absolutely stick to this range, you'll get best
366 results if you at least stay in this vicinity. Also, point
367 lists are terminated by a point of (-1, -1), so you
368 shouldn't ever use negative coordinates. ''gremlin''
369 writes out coordinates using format ``%f1.2''; it's probably
370 a good idea to use the same format if you want to modify the
371 ''grn'' code.
372 !!NOTES ON SUN/X11 COORDINATES
373
374
375 There is no longer a restriction on the range of coordinates
376 used to create objects in the ''SUN''/''X11'' version
377 of ''gremlin''. However, files with negative coordinates
378 __will__ cause problems if displayed on the
379 ''AED''.
380 !!FILES
381
382
383 __/usr/share/groff/1.17.2/font/dev__''name''__/DESC__
384
385
386 Device description file for device ''name''.
387 !!SEE ALSO
388
389
390 gremlin(1), groff(1), pic(1),
391 ideal(1)
392 !!HISTORY
393
394
395 David Slattengren and Barry Roitblat wrote the original
396 Berkeley ''grn''.
397
398
399 Daniel Senderowicz and Werner Lemberg modified it for
400 ''groff''.
401 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.