Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
grn(1)
Edit
PageHistory
Diff
Info
LikePages
GRN !!!GRN NAME SYNOPSIS DESCRIPTION GRN COMMANDS NOTES ABOUT GROFF GREMLIN FILE FORMAT ELEMENT SPECIFICATIONS NOTES ON COORDINATES NOTES ON SUN/X11 COORDINATES FILES SEE ALSO HISTORY ---- !!NAME grn - groff preprocessor for gremlin files !!SYNOPSIS __grn__ [[ __-Cv__ ] [[ __-T__''dev'' ] [[ __-M__''dir'' ] [[ __-F__''dir'' ] [[ ''file...'' ] It is possible to have whitespace between a command line option and its parameter. !!DESCRIPTION ''grn'' is a preprocessor for including ''gremlin'' pictures in ''groff'' input. ''grn'' writes to standard output, processing only input lines between two that start with __.GS__ and __.GE.__ Those lines must contain ''grn'' commands (see below). These commands request a ''gremlin'' file, and the picture in that file is converted and placed in the ''troff'' input stream. The __.GS__ request may be followed by a C, L, or R to center, left, or right justify the whole ''gremlin'' picture (default justification is center). If no ''file'' is mentioned, the standard input is read. At the end of the picture, the position on the page is the bottom of the ''gremlin'' picture. If the ''grn'' entry is ended with __.GF__ instead of __.GE__, the position is left at the top of the picture. Please note that currently only the -me macro package has support for __.GS__, __.GE__, and __.GF__. The following command-line options are understood: __-T__''dev'' Prepare output for printer ''dev''. The default device is __ps__. See groff(1) for acceptable devices. __-M__''dir'' Prepend ''dir'' to the default search path for ''gremlin'' files. The default path is (in that order) the current directory, the home directory, __/usr/lib/groff/site-tmac__, __/usr/share/groff/site-tmac__, and __/usr/share/groff/1.17.2/tmac__. __-F__''dir'' Search ''dir'' for subdirectories __dev__''name'' (''name'' is the name of the device) for the __DESC__ file before the normal __/usr/share/groff/1.17.2/font__. __-C__ Recognize __.GS__ and __.GE__ (resp. __.GF__) even when followed by a character other than space or newline. __-v__ Print the version number. !!GRN COMMANDS Each input line between __.GS__ and __.GE__ may have one ''grn'' command. Commands consist of one or two strings separated by white space, the first string being the command and the second its operand. Commands may be upper or lower case and abbreviated down to one character. Commands that affect a picture's environment (those listed before __default__, see below) are only in effect for the current picture: The environment is reinitialized to the defaults at the start of the next picture. The commands are as follows: __1__ ''N'' __2__ ''N'' __3__ ''N'' __4__ ''N'' Set ''gremlin'''s text size number 1 (2, 3, or 4) to ''N'' points. The default is 12 (resp. 16, 24, and 36). __roman__ ''f'' __italics__ ''f'' __bold__ ''f'' __special__ ''f'' Set the roman (italics, bold, or special) font to ''troff'''s font ''f'' (either a name or number). The default is R (resp. I, B, and S). __l__ ''f'' __stipple__ ''f'' Set the stipple font to ''troff'''s stipple font ''f'' (name or number). The command __stipple__ may be abbreviated down as far as `st' (to avoid confusion with __special__). There is ''no'' default for stipples (unless one is set by the default command), and it is illegal to include a ''gremlin'' picture with polygons without specifying a stipple font. __x__ ''N'' __scale__ ''N'' Magnify the picture (in addition to any default magnification) by ''N'', a floating point number larger than zero. The command __scale__ may be abbreviated down to `sc'. __narrow__ ''N'' __medium__ ''N'' __thick__ ''N'' Set the thickness of ''gremlin'''s narrow (resp. medium and thick) lines to ''N'' times 0.15pt (this value can be changed at compile time). The default is 1.0 (resp. 3.0 and 5.0), which corresponds to 0.15pt (resp. 0.45pt and 0.75pt). A thickness value of zero selects the smallest available line thickness. Negative values cause the line thickness to be proportional to the current point size. __pointscale__ '''' Scale text to match the picture. Gremlin text is usually printed in the point size specified with the commands __1__, __2__, __3__, or __4__ regardless of any scaling factors in the picture. Setting __pointscale__ will cause the point sizes to scale with the picture (within ''troff'''s limitations, of course). An operand of anything but ''off'' will turn text scaling on. __default__ Reset the picture environment defaults to the settings in the current picture. This is meant to be used as a global parameter setting mechanism at the beginning of the ''troff'' input file, but can be used at any time to reset the default settings. __width__ ''N'' Forces the picture to be ''N'' inches wide. This overrides any scaling factors present in the same picture. `__width__ ''0''' is ignored. __height__ ''N'' Forces picture to be ''N'' inches high, overriding other scaling factors. If both `width' and `height' are specified the tighter constraint will determine the scale of the picture. __Height__ and __width__ commands are not saved with a __default__ command. They will, however, affect point size scaling if that option is set. __file__ ''name'' Get picture from ''gremlin'' file ''name'' located the current directory (or in the library directory; see the __-M__ option above). If two __file__ commands are given, the second one overrides the first. If ''name'' doesn't exist, an error message is reported and processing continues from the __.GE__ line. !!NOTES ABOUT GROFF Since ''grn'' is a preprocessor, it doesn't know about current indents, point sizes, margins, number registers, etc. Consequently, no ''troff'' input can be placed between the __.GS__ and __.GE__ requests. However, ''gremlin'' text is now processed by ''troff'', so anything legal in a single line of ''troff'' input is legal in a line of ''gremlin'' text (barring `.' directives at the beginning of a line). Thus, it is possible to have equations within a ''gremlin'' figure by including in the ''gremlin'' file ''eqn'' expressions enclosed by previously defined delimiters (e.g. ''$$''). When using ''grn'' along with other preprocessors, it is best to run ''tbl'' before ''grn'', ''pic'', and/or ''ideal'' to avoid overworking ''tbl''. ''Eqn'' should always be run last. A picture is considered an entity, but that doesn't stop ''troff'' from trying to break it up if it falls off the end of a page. Placing the picture between `keeps' in -me macros will ensure proper placement. ''grn'' uses ''troff'''s number registers __g1__ through __g9__ and sets registers __g1__ and __g2__ to the width and height of the ''gremlin'' figure (in device units) before entering the __.GS__ request (this is for those who want to rewrite these macros). !!GREMLIN FILE FORMAT There exist two distinct ''gremlin'' file formats, the original format from the ''AED'' graphic terminal version, and the ''SUN'' or ''X11'' version. An extension to the ''SUN''/''X11'' version allowing reference points with negative coordinates is __not__ compatible with the ''AED'' version. As long as a ''gremlin'' file does not contain negative coordinates, either format will be read correctly by either version of ''gremlin'' or ''grn''. The other difference to the ''SUN''/''X11'' format is the use of names for picture objects (e.g., POLYGON, CURVE) instead of numbers. Files representing the same picture are shown in Table 1 in each format. The first line of each ''gremlin'' file contains either the string __gremlinfile__ (''AED'' version) or __sungremlinfile__ (''SUN''/''X11'') The second line of the file contains an orientation, and __x__ and __y__ values for a positioning point, separated by spaces. The orientation, either __0__ or __1__, is ignored by the ''SUN''/''X11'' version. __0__ means that ''gremlin'' will display things in horizontal format (drawing area wider than it is tall, with menu across top). __1__ means that ''gremlin'' will display things in vertical format (drawing area taller than it is wide, with menu on left side). __x__ and __y__ are floating point values giving a positioning point to be used when this file is read into another file. The stuff on this line really isn't all that important; a value of ``1 0.00 0.00'' is suggested. The rest of the file consists of zero or more element specifications. After the last element specification is a line containing the string ``-1''. Lines longer than 127 characters are chopped to this limit. !!ELEMENT SPECIFICATIONS The first line of each element contains a single decimal number giving the type of the element (''AED'' version) or its ASCII name (''SUN''/''X11'' version). See Table 2. 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). After the points comes a line containing two decimal values, giving the brush and size for the element. The brush determines the style in which things are drawn. For vectors, arcs, and curves there are six legal brush values: 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: 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. The last line of each element contains a decimal number and a string of characters, separated by a single space. The number is a count of the number of characters in the string. This information is only used for text elements, and contains the text string. There can be spaces inside the text. For arcs, curves, and vectors, this line of the element contains the string ``0''. !!NOTES ON COORDINATES ''gremlin'' was designed for ''AED''s, and its coordinates reflect the ''AED'' coordinate space. For vertical pictures, x-values range 116 to 511, and y-values from 0 to 483. For horizontal pictures, x-values range from 0 to 511 and y-values range from 0 to 367. Although you needn't absolutely stick to this range, you'll get best results if you at least stay in this vicinity. Also, point lists are terminated by a point of (-1, -1), so you shouldn't ever use negative coordinates. ''gremlin'' writes out coordinates using format ``%f1.2''; it's probably a good idea to use the same format if you want to modify the ''grn'' code. !!NOTES ON SUN/X11 COORDINATES There is no longer a restriction on the range of coordinates used to create objects in the ''SUN''/''X11'' version of ''gremlin''. However, files with negative coordinates __will__ cause problems if displayed on the ''AED''. !!FILES __/usr/share/groff/1.17.2/font/dev__''name''__/DESC__ Device description file for device ''name''. !!SEE ALSO gremlin(1), groff(1), pic(1), ideal(1) !!HISTORY David Slattengren and Barry Roitblat wrote the original Berkeley ''grn''. Daniel Senderowicz and Werner Lemberg modified it for ''groff''. ----
5 pages link to
grn(1)
:
Man1g
roff(7)
troff(1)
groff(1)
grog(1)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.