2 Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
3 Free Software Foundation, Inc.
5 Permission is granted to make and distribute verbatim copies of
6 this manual provided the copyright notice and this permission notice
7 are preserved on all copies.
9 Permission is granted to copy and distribute modified versions of this
10 manual under the conditions for verbatim copying, provided that the
11 entire resulting derived work is distributed under the terms of a
12 permission notice identical to this one.
14 Permission is granted to copy and distribute translations of this
15 manual into another language, under the above conditions for modified
16 versions, except that this permission notice may be included in
17 translations approved by the Free Software Foundation instead of in
22 .\" Like TP, but if specified indent is more than half
23 .\" the current line-length - indent, use the default indent.
25 . ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
30 . if '\\*(.T'ps' .ft \\$1
34 .TH GROPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
39 grops \- PostScript driver for groff
58 It is possible to have whitespace between a command line option and its
65 translates the output of GNU
71 should be invoked by using the groff command
76 .if '@DEVICE@'ps' (Actually, this is the default for groff.)
78 If no files are given,
80 reads the standard input.
86 to read the standard input.
88 PostScript output is written to the standard output.
94 options can be passed to
104 doesn't produce a valid document structure (conforming to the Document
105 Structuring Convention) if called with multiple file arguments.
107 To print such concatenated output it is necessary to deactivate DSC
108 handling in the printing program or previewer.
112 below for a guide how to install fonts for
120 Provide workarounds for older printers, broken spoolers, and previewers.
124 produces output at PostScript LanguageLevel\~2 that conforms to the
125 Document Structuring Conventions version 3.0.
127 Some older printers, spoolers, and previewers can't handle such output.
133 does to make its output acceptable to such programs.
135 A value of\~0 causes grops not to employ any workarounds.
139 .B %%Begin\%Document\%Setup
141 .B %%End\%Document\%Setup
142 comments should be generated;
143 this is needed for early versions of TranScript that get confused by
146 comment and the first
151 Add\~2 if lines in included files beginning with
153 should be stripped out; this is needed for Sun's pageview previewer.
162 stripped out of included files; this is needed for spoolers that
170 Add\~8 if the first line of the PostScript output should be
174 this is needed when using Sun's Newsprint with a printer that requires
178 Add\~16 if no media size information should be included in the document
179 (this is, neither use
185 This was the behaviour of groff version 1.18.1 and earlier; it is needed
186 for older printers which don't understand PostScript LanguageLevel\~2.
188 It is also necessary if the output is further processed to get an
189 encapsulated PS (EPS) file \[en] see below.
192 The default value can be specified by a
199 command in the DESC file.
201 Otherwise the default value is\~0.
214 to the search path for prologue, font, and device description files;
216 is the name of the device, usually
221 Guess the page length.
223 This generates PostScript code that guesses the page length.
225 The guess is correct only if the imageable area is vertically
226 centered on the page.
228 This option allows you to generate documents that can be printed
229 both on letter (8.5\[mu]11) paper and on A4 paper without change.
233 This option may be used to add a directory to the search path for
234 files on the command line and files named in
235 .B \[rs]X'ps: import'
240 The search path is initialized with the current directory.
242 This option may be specified more than once; the directories are then
243 searched in the order specified (but before the current directory).
245 If you want to make the current directory be read before other directories,
248 at the appropriate place.
251 No directory search is performed for files with an absolute file name.
255 Print the document in landscape format.
259 Turn manual feed on for the document.
263 Set physical dimension of output medium.
272 file; it accepts the same arguments as the
277 .B groff_font (@MAN5EXT@)
281 .BI \-P prologue-file
284 (in the font path) as the prologue instead of the default prologue file
287 This option overrides the environment variable
292 Lines should be drawn using a thickness of
294 thousandths of an em.
296 If this option is not given, the line thickness defaults to 0.04\~em.
300 Print the version number.
307 must be in the format output by
308 .BR @g@troff (@MAN1EXT@).
311 .BR groff_out (@MAN5EXT@).
314 In addition, the device and font description files for the device used
315 must meet certain requirements:
317 The resolution must be an integer multiple of\~72 times the
322 device uses a resolution of 72000 and a sizescale of 1000.
325 The device description file must contain a valid paper size; see
326 .BR groff_font (@MAN5EXT@)
327 for more information.
330 Each font description file must contain a command
332 .BI internalname\ psname
334 which says that the PostScript name of the font is
337 It may also contain a command
339 .BI encoding\ enc_file
342 the PostScript font should be reencoded using the encoding described in
344 this file should consist of a sequence of lines of the form:
351 is the PostScript name of the character,
354 is its position in the encoding expressed as a decimal integer; valid
355 values are in the range 0 to\~255.
359 and blank lines are ignored.
361 The code for each character given in the font file must correspond
362 to the code for the character in encoding file, or to the code in the default
363 encoding for the font if the PostScript font is not to be reencoded.
365 This code can be used with the
369 to select the character,
370 even if the character does not have a groff name.
372 Every character in the font file must exist in the PostScript font, and
373 the widths given in the font file must match the widths used
374 in the PostScript font.
377 assumes that a character with a groff name of
379 is blank (makes no marks on the page);
380 it can make use of such a character to generate more efficient and
381 compact PostScript output.
386 is able to display all glyphs in a PostScript font, not only 256.
388 (or the default encoding if no encoding file specified) just defines the
389 order of glyphs for the first 256 characters; all other glyphs are
390 accessed with additional encoding vectors which
396 can automatically include the downloadable fonts necessary
397 to print the document.
399 Such fonts must be in PFA format.
402 .BR \%pfbtops (@MAN1EXT@)
403 to convert a Type\~1 font in PFB format.
405 Any downloadable fonts which should, when required, be included by
407 must be listed in the file
408 .BR @FONTDIR@/devps/download ;
409 this should consist of lines of the form
418 is the PostScript name of the font,
421 is the name of the file containing the font;
424 and blank lines are ignored;
425 fields may be separated by tabs or spaces;
427 is searched for using the same mechanism that is used
428 for groff font metric files.
432 file itself is also searched for using this mechanism;
433 currently, only the first found file in the font path is used.
436 If the file containing a downloadable font or imported document
437 conforms to the Adobe Document Structuring Conventions,
440 interprets any comments in the files sufficiently to ensure that its
441 own output is conforming.
443 It also supplies any needed font resources that are listed in the
446 as well as any needed file resources.
448 It is also able to handle inter-resource dependencies.
450 For example, suppose that you have a downloadable font called Garamond,
451 and also a downloadable font called Garamond-Outline
452 which depends on Garamond
453 (typically it would be defined to copy Garamond's font dictionary,
454 and change the PaintType),
455 then it is necessary for Garamond to appear before Garamond-Outline
456 in the PostScript document.
459 handles this automatically
460 provided that the downloadable font file for Garamond-Outline
461 indicates its dependence on Garamond by means of
462 the Document Structuring Conventions,
463 for example by beginning with the following lines
467 %!PS-Adobe-3.0 Resource-Font
470 %%DocumentNeededResources: font Garamond
476 %%IncludeResource: font Garamond
479 In this case both Garamond and Garamond-Outline would need to be listed
484 A downloadable font should not include its own name in a
485 .B %%Document\%Supplied\%Resources
495 .BR %%Document\%Needed\%Resources ,
496 .BR %%Document\%Supplied\%Resources ,
497 .BR %%Include\%Resource ,
498 .BR %%Begin\%Resource ,
503 .BR %%Document\%Needed\%Fonts ,
504 .BR %%Document\%Supplied\%Fonts ,
505 .BR %%Include\%Font ,
514 there are styles called
520 mounted at font positions 1 to\~4.
522 The fonts are grouped into families
532 having members in each of these styles:
544 AvantGarde-BookOblique
556 AvantGarde-DemiOblique
628 Helvetica-BoldOblique
640 Helvetica-Narrow-Oblique
646 Helvetica-Narrow-Bold
652 Helvetica-Narrow-BoldOblique
658 NewCenturySchlbk-Roman
664 NewCenturySchlbk-Italic
670 NewCenturySchlbk-Bold
676 NewCenturySchlbk-BoldItalic
729 There is also the following font which is not a member of a family:
735 ZapfChancery-MediumItalic
740 There are also some special fonts called
742 for the PS Symbol font, and
744 containing slanted lowercase Greek letters taken from PS Symbol.
746 Zapf Dingbats is available as
748 and a reversed version of ZapfDingbats (with symbols pointing in the opposite
749 direction) is available as
751 most characters in these fonts are unnamed and must be accessed using
755 The default color for
759 is black; for colors defined in the `rgb' color space
761 is used, for `cmy' and `cmyk'
768 is a PostScript LanguageLevel\~2 command and thus not available on some
773 understands various X\~commands produced using the
777 only interprets commands that begin with a
782 .BI \[rs]X'ps:\ exec\ code '
783 This executes the arbitrary PostScript commands in
786 The PostScript currentpoint is set to the position of the
788 command before executing
791 The origin is at the top left corner of the page,
792 and y\~coordinates increase down the page.
796 is defined that converts groff units
797 to the coordinate system in effect (provided the user doesn't change the
808 \[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
813 draws a horizontal line one inch long.
816 may make changes to the graphics state,
817 but any changes persist only to the end of the page.
819 A dictionary containing the definitions specified by the
823 is on top of the dictionary stack.
825 If your code adds definitions to this dictionary,
826 you should allocate space for them using
827 .BI \[rs]X'ps\ mdef \ n '\fR.
829 Any definitions persist only until the end of the page.
833 escape sequence with an argument that names a macro,
835 can extend over multiple lines.
846 \&\[rs]nx u 0 rlineto
854 is another way to draw a horizontal line one inch long.
856 Note the single backslash before `nx' \[en] the only reason to use a number
857 register while defining the macro `y' is to convert a user-specified
858 dimension `1i' to internal groff units which are in turn converted to PS
865 wraps user-specified PostScript code into a dictionary, nothing more.
867 In particular, it doesn't start and end the inserted code with
873 This must be supplied by the user, if necessary.
878 .BI \[rs]X'ps:\ file\ name '
879 This is the same as the
881 command except that the PostScript code is read from file
885 .BI \[rs]X'ps:\ def\ code '
886 Place a PostScript definition contained in
890 There should be at most one definition per
894 Long definitions can be split over several
899 arguments are simply joined together separated by newlines.
901 The definitions are placed in a dictionary which is automatically
902 pushed on the dictionary stack when an
908 escape sequence with an argument that names a macro,
910 can extend over multiple lines.
913 .BI \[rs]X'ps:\ mdef\ n\ code '
923 needs to know how many definitions
926 so that it can create an appropriately sized PostScript dictionary
930 .BI \[rs]X'ps:\ import\ file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
931 Import a PostScript graphic from
940 give the bounding box of the graphic in the default PostScript
941 coordinate system; they should all be integers;
945 are the x and y\~coordinates of the lower left
946 corner of the graphic;
950 are the x and y\~coordinates of the upper right corner of the graphic;
954 are integers that give the desired width and height in groff
955 units of the graphic.
958 The graphic is scaled so that it has this width and height
959 and translated so that the lower left corner of the graphic is
960 located at the position associated with
964 If the height argument is omitted it is scaled uniformly in the
965 x and y\~directions so that it has the specified width.
968 Note that the contents of the
970 command are not interpreted by
972 so vertical space for the graphic is not automatically added,
977 arguments are not allowed to have attached scaling indicators.
980 If the PostScript file complies with the Adobe Document Structuring
981 Conventions and contains a
983 comment, then the bounding box can be automatically
984 extracted from within groff by using the
990 .BR groff_tmac (@MAN5EXT@)
991 for a description of the
993 macro which provides a convenient high-level interface for inclusion of
997 .B \[rs]X'ps:\ invis'
999 .B \[rs]X'ps:\ endinvis'
1000 No output is generated for text and drawing commands
1001 that are bracketed with these
1005 These commands are intended for use when output from
1007 is previewed before being processed with
1009 if the previewer is unable to display certain characters
1010 or other constructs, then other substitute characters or constructs
1011 can be used for previewing by bracketing them with these
1019 is not able to display a proper
1021 character because the standard X11 fonts do not provide it;
1022 this problem can be overcome by executing the following
1028 \&.char \[rs](em \[rs]X'ps: invis'\[rs]
1029 \[rs]Z'\[rs]v'-.25m'\[rs]h'.05m'\[rs]D'l .9m 0'\[rs]h'.05m''\[rs]
1030 \[rs]X'ps: endinvis'\[rs](em
1037 is unable to display the
1039 character and draws the line,
1045 and ignores the line (this code is already in file
1047 which is loaded if a document intended for
1054 If a PostScript procedure
1056 has been defined via a
1060 device command, it is executed at the beginning
1061 of every page (before anything is drawn or written by groff).
1062 For example, to underlay the page contents with the word
1063 `DRAFT' in light gray, you might use
1071 { gsave .9 setgray clippath pathbbox exch 2 copy
1072 .5 mul exch .5 mul translate atan rotate pop pop
1073 /NewCenturySchlbk-Roman findfont 200 scalefont setfont
1074 (DRAFT) dup stringwidth pop \-.5 mul \-70 moveto show
1083 Or, to cause lines and polygons to be drawn with square linecaps
1084 and mitered linejoins instead of the round linecaps and linejoins
1094 /BPhook { 2 setlinecap 0 setlinejoin } def
1101 (square linecaps, as opposed to butt linecaps (0 setlinecap),
1102 give true corners in boxed tables even though the lines are
1106 .SS Encapsulated PostScript
1108 itself doesn't emit bounding box information.
1110 With the help of Ghostscript the following simple script,
1112 produces an encapsulated PS file.
1119 groff \-P\-b16 $1 >$1.ps
1120 gs \-dNOPAUSE \-sDEVICE=bbox \-\- $1.ps 2>$1.bbox
1122 | sed \-e "/\[ha]%%Orientation/r$1.bbox" \[rs]
1123 \-e "/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/" >$1.eps
1143 .SS TrueType and other font formats
1144 TrueType fonts can be used with
1146 if converted first to
1148 format, a special PostScript wrapper equivalent to the
1149 PFA format mentioned in
1150 .BR \%pfbtops (@MAN1EXT@).
1152 There are several different methods to generate a type42
1153 wrapper and most of them involve the use of a PostScript
1154 interpreter such as Ghostscript \[en] see
1158 Yet, the easiest method involves the use of the application
1163 (version 1.3.1) to generate type42
1164 font wrappers and well-formed AFM files that can be fed to
1166 .BR \%afmtodit (@MAN1EXT@)
1167 script to create appropriate metric files.
1169 The resulting font wrappers should be added to the
1173 source code can be downloaded from
1174 .UR ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1175 ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1179 Another solution for creating type42 wrappers is to use FontForge,
1181 .UR http://\:fontforge.sf.net
1182 http://\:fontforge.sf.net
1184 This font editor can convert most outline font formats.
1187 .SH FONT INSTALLATION
1189 This section gives a summary of the above explanations; it can serve
1190 as a step-by-step font installation guide for
1196 \h'-\w'\*[BU]'u'\*[BU]\c
1199 Convert your font to something groff understands.
1201 This is either a PostScript Type\~1 font in PFA format or a
1202 PostScript Type\~42 font, together with an AFM file.
1205 The very first characters in a PFA file look like this:
1209 .B %!PS-AdobeFont-1.0:
1213 A PFB file has this also in the first line, but the string is
1214 preceded with some binary bytes.
1217 The very first characters in a Type\~42 font file look like this:
1221 .B %!PS-TrueTypeFont
1225 This is a wrapper format for TrueType fonts.
1227 Old PS printers might not support it (this is, they don't have a
1228 built-in TrueType font interpreter).
1231 If your font is in PFB format (such fonts normally have `.pfb' as
1232 the file extension), you might use groff's
1233 .BR \%pfbtops (@MAN1EXT@)
1234 program to convert it to PFA.
1236 For TrueType fonts, try
1240 For all other font formats use
1242 which can convert most outline font formats.
1245 Convert the AFM file to a groff font description file with the
1246 .BR \%afmtodit (@MAN1EXT@)
1253 afmtodit Foo-Bar-Bold.afm textmap FBB
1257 which converts the metric file `Foo-Bar-Bold.afm' to the groff
1260 If you have a font family which comes with normal, bold, italic,
1261 and bold italic faces, it is recommended to use the letters
1267 respectively, as postfixes in the groff font names to make groff's
1268 `.fam' request work.
1270 An example is groff's built-in Times-Roman font: The font family name
1273 and the groff font names are
1281 Install both the groff font description files and the fonts in a
1282 `devps' subdirectory of the font path which groff finds.
1287 .BR troff (@MAN1EXT@)
1288 man page which lists the actual value of the font path.
1290 Note that groff doesn't use the AFM files (but it is a good idea to
1294 Register all fonts which must be downloaded to the printer in the
1295 `devps/download' file.
1297 Only the first occurrence of this file in the font path is read.
1299 This means that you should copy the default `download' file to the
1300 first directory in your font path and add your fonts there.
1302 To continue the above example we assume that the PS font name for
1303 Foo-Bar-Bold.pfa is `XY-Foo-Bar-Bold' (the PS font name is stored in the
1305 field in the `FBB' file), thus the following line should be added to
1310 .B XY-Foo-Bar-Bold Foo-Bar-Bold.pfa
1317 groff versions 1.19.2 and earlier contain a slightly different set of
1318 the 35 Adobe core fonts; the difference is mainly the lack of the `Euro'
1319 glyph and a reduced set of kerning pairs.
1321 For backwards compatibility, these old fonts are installed also in the
1324 .BR @OLDFONTDIR@/devps
1330 To use them, make sure that
1332 finds the fonts before the default system fonts (with the same names):
1333 Either add command line option
1339 .B groff \-Tps \-P\-F \-P@OLDFONTDIR@ .\|.\|.
1342 or add the directory to groff's font path environment variable
1345 .B GROFF_FONT_PATH=@OLDFONTDIR@
1359 (in the font path) instead of the default prologue file
1364 overrides this environment variable.
1370 A list of directories in which to search for the
1372 directory in addition to the default ones.
1375 .BR @g@troff (@MAN1EXT@)
1377 .BR \%groff_font (@MAN5EXT@)
1383 .Tp \w'\fB@FONTDIR@/devps/download'u+2n
1384 .B @FONTDIR@/devps/DESC
1385 Device description file.
1388 .BI @FONTDIR@/devps/ F
1389 Font description file for font
1393 .B @FONTDIR@/devps/download
1394 List of downloadable fonts.
1397 .B @FONTDIR@/devps/text.enc
1398 Encoding used for text fonts.
1401 .B @MACRODIR@/ps.tmac
1404 automatically loaded by
1408 .B @MACRODIR@/pspic.tmac
1412 automatically loaded by
1416 .B @MACRODIR@/psold.tmac
1417 Macros to disable use of characters not present in older
1418 PostScript printers (e.g., `eth' or `thorn').
1421 .BI /tmp/grops XXXXXX
1427 .BR \%afmtodit (@MAN1EXT@),
1428 .BR groff (@MAN1EXT@),
1429 .BR @g@troff (@MAN1EXT@),
1430 .BR \%pfbtops (@MAN1EXT@),
1431 .BR \%groff_out (@MAN5EXT@),
1432 .BR \%groff_font (@MAN5EXT@),
1433 .BR \%groff_char (@MAN7EXT@),
1434 .BR \%groff_tmac (@MAN5EXT@)
1437 .UR http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf
1438 PostScript Language Document Structuring Conventions Specification
1442 .\" Local Variables: