2 Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008,
4 Free Software Foundation, Inc.
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.
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.
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
23 .\" Like TP, but if specified indent is more than half
24 .\" the current line-length - indent, use the default indent.
26 . ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
31 . if '\\*(.T'ps' .ft \\$1
35 .TH GROPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
40 grops \- PostScript driver for groff
59 It is possible to have whitespace between a command line option and its
66 translates the output of GNU
72 should be invoked by using the groff command
77 .if '@DEVICE@'ps' (Actually, this is the default for groff.)
79 If no files are given,
81 reads the standard input.
87 to read the standard input.
89 PostScript output is written to the standard output.
95 options can be passed to
105 doesn't produce a valid document structure (conforming to the Document
106 Structuring Convention) if called with multiple file arguments.
108 To print such concatenated output it is necessary to deactivate DSC
109 handling in the printing program or previewer.
113 below for a guide how to install fonts for
121 Provide workarounds for older printers, broken spoolers, and previewers.
125 produces output at PostScript LanguageLevel\~2 that conforms to the
126 Document Structuring Conventions version 3.0.
128 Some older printers, spoolers, and previewers can't handle such output.
134 does to make its output acceptable to such programs.
136 A value of\~0 causes grops not to employ any workarounds.
140 .B %%Begin\%Document\%Setup
142 .B %%End\%Document\%Setup
143 comments should be generated;
144 this is needed for early versions of TranScript that get confused by
147 comment and the first
152 Add\~2 if lines in included files beginning with
154 should be stripped out; this is needed for Sun's pageview previewer.
163 stripped out of included files; this is needed for spoolers that
171 Add\~8 if the first line of the PostScript output should be
175 this is needed when using Sun's Newsprint with a printer that requires
179 Add\~16 if no media size information should be included in the document
180 (this is, neither use
186 This was the behaviour of groff version 1.18.1 and earlier; it is needed
187 for older printers which don't understand PostScript LanguageLevel\~2.
189 It is also necessary if the output is further processed to get an
190 encapsulated PS (EPS) file \[en] see below.
193 The default value can be specified by a
200 command in the DESC file.
202 Otherwise the default value is\~0.
215 to the search path for prologue, font, and device description files;
217 is the name of the device, usually
222 Guess the page length.
224 This generates PostScript code that guesses the page length.
226 The guess is correct only if the imageable area is vertically
227 centered on the page.
229 This option allows you to generate documents that can be printed
230 both on letter (8.5\[mu]11) paper and on A4 paper without change.
234 This option may be used to add a directory to the search path for
235 files on the command line and files named in
236 .B \[rs]X'ps: import'
241 The search path is initialized with the current directory.
243 This option may be specified more than once; the directories are then
244 searched in the order specified (but before the current directory).
246 If you want to make the current directory be read before other directories,
249 at the appropriate place.
252 No directory search is performed for files with an absolute file name.
256 Print the document in landscape format.
260 Turn manual feed on for the document.
264 Set physical dimension of output medium.
273 file; it accepts the same arguments as the
278 .B groff_font (@MAN5EXT@)
282 .BI \-P prologue-file
285 (in the font path) as the prologue instead of the default prologue file
288 This option overrides the environment variable
293 Lines should be drawn using a thickness of
295 thousandths of an em.
297 If this option is not given, the line thickness defaults to 0.04\~em.
301 Print the version number.
308 must be in the format output by
309 .BR @g@troff (@MAN1EXT@).
312 .BR groff_out (@MAN5EXT@).
315 In addition, the device and font description files for the device used
316 must meet certain requirements:
318 The resolution must be an integer multiple of\~72 times the
323 device uses a resolution of 72000 and a sizescale of 1000.
326 The device description file must contain a valid paper size; see
327 .BR groff_font (@MAN5EXT@)
328 for more information.
331 Each font description file must contain a command
333 .BI internalname\ psname
335 which says that the PostScript name of the font is
338 It may also contain a command
340 .BI encoding\ enc_file
343 the PostScript font should be reencoded using the encoding described in
345 this file should consist of a sequence of lines of the form:
352 is the PostScript name of the character,
355 is its position in the encoding expressed as a decimal integer; valid
356 values are in the range 0 to\~255.
360 and blank lines are ignored.
362 The code for each character given in the font file must correspond
363 to the code for the character in encoding file, or to the code in the default
364 encoding for the font if the PostScript font is not to be reencoded.
366 This code can be used with the
370 to select the character,
371 even if the character does not have a groff name.
373 Every character in the font file must exist in the PostScript font, and
374 the widths given in the font file must match the widths used
375 in the PostScript font.
378 assumes that a character with a groff name of
380 is blank (makes no marks on the page);
381 it can make use of such a character to generate more efficient and
382 compact PostScript output.
387 is able to display all glyphs in a PostScript font, not only 256.
389 (or the default encoding if no encoding file specified) just defines the
390 order of glyphs for the first 256 characters; all other glyphs are
391 accessed with additional encoding vectors which
397 can automatically include the downloadable fonts necessary
398 to print the document.
400 Such fonts must be in PFA format.
403 .BR \%pfbtops (@MAN1EXT@)
404 to convert a Type\~1 font in PFB format.
406 Any downloadable fonts which should, when required, be included by
408 must be listed in the file
409 .BR @FONTDIR@/devps/download ;
410 this should consist of lines of the form
419 is the PostScript name of the font,
422 is the name of the file containing the font;
425 and blank lines are ignored;
426 fields may be separated by tabs or spaces;
428 is searched for using the same mechanism that is used
429 for groff font metric files.
433 file itself is also searched for using this mechanism;
434 currently, only the first found file in the font path is used.
437 If the file containing a downloadable font or imported document
438 conforms to the Adobe Document Structuring Conventions,
441 interprets any comments in the files sufficiently to ensure that its
442 own output is conforming.
444 It also supplies any needed font resources that are listed in the
447 as well as any needed file resources.
449 It is also able to handle inter-resource dependencies.
451 For example, suppose that you have a downloadable font called Garamond,
452 and also a downloadable font called Garamond-Outline
453 which depends on Garamond
454 (typically it would be defined to copy Garamond's font dictionary,
455 and change the PaintType),
456 then it is necessary for Garamond to appear before Garamond-Outline
457 in the PostScript document.
460 handles this automatically
461 provided that the downloadable font file for Garamond-Outline
462 indicates its dependence on Garamond by means of
463 the Document Structuring Conventions,
464 for example by beginning with the following lines
468 %!PS-Adobe-3.0 Resource-Font
471 %%DocumentNeededResources: font Garamond
477 %%IncludeResource: font Garamond
480 In this case both Garamond and Garamond-Outline would need to be listed
485 A downloadable font should not include its own name in a
486 .B %%Document\%Supplied\%Resources
496 .BR %%Document\%Needed\%Resources ,
497 .BR %%Document\%Supplied\%Resources ,
498 .BR %%Include\%Resource ,
499 .BR %%Begin\%Resource ,
504 .BR %%Document\%Needed\%Fonts ,
505 .BR %%Document\%Supplied\%Fonts ,
506 .BR %%Include\%Font ,
515 there are styles called
521 mounted at font positions 1 to\~4.
523 The fonts are grouped into families
533 having members in each of these styles:
545 AvantGarde-BookOblique
557 AvantGarde-DemiOblique
629 Helvetica-BoldOblique
641 Helvetica-Narrow-Oblique
647 Helvetica-Narrow-Bold
653 Helvetica-Narrow-BoldOblique
659 NewCenturySchlbk-Roman
665 NewCenturySchlbk-Italic
671 NewCenturySchlbk-Bold
677 NewCenturySchlbk-BoldItalic
730 There is also the following font which is not a member of a family:
736 ZapfChancery-MediumItalic
741 There are also some special fonts called
743 for the PS Symbol font, and
745 containing slanted lowercase Greek letters taken from PS Symbol.
747 Zapf Dingbats is available as
749 and a reversed version of ZapfDingbats (with symbols pointing in the opposite
750 direction) is available as
752 most characters in these fonts are unnamed and must be accessed using
756 The default color for
760 is black; for colors defined in the `rgb' color space
762 is used, for `cmy' and `cmyk'
769 is a PostScript LanguageLevel\~2 command and thus not available on some
774 understands various X\~commands produced using the
778 only interprets commands that begin with a
783 .BI \[rs]X'ps:\ exec\ code '
784 This executes the arbitrary PostScript commands in
787 The PostScript currentpoint is set to the position of the
789 command before executing
792 The origin is at the top left corner of the page,
793 and y\~coordinates increase down the page.
797 is defined that converts groff units
798 to the coordinate system in effect (provided the user doesn't change the
809 \[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
814 draws a horizontal line one inch long.
817 may make changes to the graphics state,
818 but any changes persist only to the end of the page.
820 A dictionary containing the definitions specified by the
824 is on top of the dictionary stack.
826 If your code adds definitions to this dictionary,
827 you should allocate space for them using
828 .BI \[rs]X'ps\ mdef \ n '\fR.
830 Any definitions persist only until the end of the page.
834 escape sequence with an argument that names a macro,
836 can extend over multiple lines.
847 \&\[rs]nx u 0 rlineto
855 is another way to draw a horizontal line one inch long.
857 Note the single backslash before `nx' \[en] the only reason to use a number
858 register while defining the macro `y' is to convert a user-specified
859 dimension `1i' to internal groff units which are in turn converted to PS
866 wraps user-specified PostScript code into a dictionary, nothing more.
868 In particular, it doesn't start and end the inserted code with
874 This must be supplied by the user, if necessary.
879 .BI \[rs]X'ps:\ file\ name '
880 This is the same as the
882 command except that the PostScript code is read from file
886 .BI \[rs]X'ps:\ def\ code '
887 Place a PostScript definition contained in
891 There should be at most one definition per
895 Long definitions can be split over several
900 arguments are simply joined together separated by newlines.
902 The definitions are placed in a dictionary which is automatically
903 pushed on the dictionary stack when an
909 escape sequence with an argument that names a macro,
911 can extend over multiple lines.
914 .BI \[rs]X'ps:\ mdef\ n\ code '
924 needs to know how many definitions
927 so that it can create an appropriately sized PostScript dictionary
931 .BI \[rs]X'ps:\ import\ file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
932 Import a PostScript graphic from
941 give the bounding box of the graphic in the default PostScript
942 coordinate system; they should all be integers;
946 are the x and y\~coordinates of the lower left
947 corner of the graphic;
951 are the x and y\~coordinates of the upper right corner of the graphic;
955 are integers that give the desired width and height in groff
956 units of the graphic.
959 The graphic is scaled so that it has this width and height
960 and translated so that the lower left corner of the graphic is
961 located at the position associated with
965 If the height argument is omitted it is scaled uniformly in the
966 x and y\~directions so that it has the specified width.
969 Note that the contents of the
971 command are not interpreted by
973 so vertical space for the graphic is not automatically added,
978 arguments are not allowed to have attached scaling indicators.
981 If the PostScript file complies with the Adobe Document Structuring
982 Conventions and contains a
984 comment, then the bounding box can be automatically
985 extracted from within groff by using the
991 .BR groff_tmac (@MAN5EXT@)
992 for a description of the
994 macro which provides a convenient high-level interface for inclusion of
998 .B \[rs]X'ps:\ invis'
1000 .B \[rs]X'ps:\ endinvis'
1001 No output is generated for text and drawing commands
1002 that are bracketed with these
1006 These commands are intended for use when output from
1008 is previewed before being processed with
1010 if the previewer is unable to display certain characters
1011 or other constructs, then other substitute characters or constructs
1012 can be used for previewing by bracketing them with these
1020 is not able to display a proper
1022 character because the standard X11 fonts do not provide it;
1023 this problem can be overcome by executing the following
1029 \&.char \[rs](em \[rs]X'ps: invis'\[rs]
1030 \[rs]Z'\[rs]v'-.25m'\[rs]h'.05m'\[rs]D'l .9m 0'\[rs]h'.05m''\[rs]
1031 \[rs]X'ps: endinvis'\[rs](em
1038 is unable to display the
1040 character and draws the line,
1046 and ignores the line (this code is already in file
1048 which is loaded if a document intended for
1055 If a PostScript procedure
1057 has been defined via a
1061 device command, it is executed at the beginning
1062 of every page (before anything is drawn or written by groff).
1063 For example, to underlay the page contents with the word
1064 `DRAFT' in light gray, you might use
1072 { gsave .9 setgray clippath pathbbox exch 2 copy
1073 .5 mul exch .5 mul translate atan rotate pop pop
1074 /NewCenturySchlbk-Roman findfont 200 scalefont setfont
1075 (DRAFT) dup stringwidth pop \-.5 mul \-70 moveto show
1084 Or, to cause lines and polygons to be drawn with square linecaps
1085 and mitered linejoins instead of the round linecaps and linejoins
1095 /BPhook { 2 setlinecap 0 setlinejoin } def
1102 (square linecaps, as opposed to butt linecaps (0 setlinecap),
1103 give true corners in boxed tables even though the lines are
1107 .SS Encapsulated PostScript
1109 itself doesn't emit bounding box information.
1111 With the help of Ghostscript the following simple script,
1113 produces an encapsulated PS file.
1120 groff \-P\-b16 $1 >$1.ps
1121 gs \-dNOPAUSE \-sDEVICE=bbox \-\- $1.ps 2>$1.bbox
1123 | sed \-e "/\[ha]%%Orientation/r$1.bbox" \[rs]
1124 \-e "/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/" >$1.eps
1144 .SS TrueType and other font formats
1145 TrueType fonts can be used with
1147 if converted first to
1149 format, a special PostScript wrapper equivalent to the
1150 PFA format mentioned in
1151 .BR \%pfbtops (@MAN1EXT@).
1153 There are several different methods to generate a type42
1154 wrapper and most of them involve the use of a PostScript
1155 interpreter such as Ghostscript \[en] see
1159 Yet, the easiest method involves the use of the application
1164 (version 1.3.1) to generate type42
1165 font wrappers and well-formed AFM files that can be fed to
1167 .BR \%afmtodit (@MAN1EXT@)
1168 script to create appropriate metric files.
1170 The resulting font wrappers should be added to the
1174 source code can be downloaded from
1175 .UR ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1176 ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1180 Another solution for creating type42 wrappers is to use FontForge,
1182 .UR http://\:fontforge.sf.net
1183 http://\:fontforge.sf.net
1185 This font editor can convert most outline font formats.
1188 .SH FONT INSTALLATION
1190 This section gives a summary of the above explanations; it can serve
1191 as a step-by-step font installation guide for
1197 \h'-\w'\*[BU]'u'\*[BU]\c
1200 Convert your font to something groff understands.
1202 This is either a PostScript Type\~1 font in PFA format or a
1203 PostScript Type\~42 font, together with an AFM file.
1206 The very first characters in a PFA file look like this:
1210 .B %!PS-AdobeFont-1.0:
1214 A PFB file has this also in the first line, but the string is
1215 preceded with some binary bytes.
1218 The very first characters in a Type\~42 font file look like this:
1222 .B %!PS-TrueTypeFont
1226 This is a wrapper format for TrueType fonts.
1228 Old PS printers might not support it (this is, they don't have a
1229 built-in TrueType font interpreter).
1232 If your font is in PFB format (such fonts normally have `.pfb' as
1233 the file extension), you might use groff's
1234 .BR \%pfbtops (@MAN1EXT@)
1235 program to convert it to PFA.
1237 For TrueType fonts, try
1241 For all other font formats use
1243 which can convert most outline font formats.
1246 Convert the AFM file to a groff font description file with the
1247 .BR \%afmtodit (@MAN1EXT@)
1254 afmtodit Foo-Bar-Bold.afm textmap FBB
1258 which converts the metric file `Foo-Bar-Bold.afm' to the groff
1261 If you have a font family which comes with normal, bold, italic,
1262 and bold italic faces, it is recommended to use the letters
1268 respectively, as postfixes in the groff font names to make groff's
1269 `.fam' request work.
1271 An example is groff's built-in Times-Roman font: The font family name
1274 and the groff font names are
1282 Install both the groff font description files and the fonts in a
1283 `devps' subdirectory of the font path which groff finds.
1288 .BR troff (@MAN1EXT@)
1289 man page which lists the actual value of the font path.
1291 Note that groff doesn't use the AFM files (but it is a good idea to
1295 Register all fonts which must be downloaded to the printer in the
1296 `devps/download' file.
1298 Only the first occurrence of this file in the font path is read.
1300 This means that you should copy the default `download' file to the
1301 first directory in your font path and add your fonts there.
1303 To continue the above example we assume that the PS font name for
1304 Foo-Bar-Bold.pfa is `XY-Foo-Bar-Bold' (the PS font name is stored in the
1306 field in the `FBB' file), thus the following line should be added to
1311 .B XY-Foo-Bar-Bold Foo-Bar-Bold.pfa
1318 groff versions 1.19.2 and earlier contain a slightly different set of
1319 the 35 Adobe core fonts; the difference is mainly the lack of the `Euro'
1320 glyph and a reduced set of kerning pairs.
1322 For backwards compatibility, these old fonts are installed also in the
1325 .BR @OLDFONTDIR@/devps
1331 To use them, make sure that
1333 finds the fonts before the default system fonts (with the same names):
1334 Either add command line option
1340 .B groff \-Tps \-P\-F \-P@OLDFONTDIR@ .\|.\|.
1343 or add the directory to groff's font path environment variable
1346 .B GROFF_FONT_PATH=@OLDFONTDIR@
1360 (in the font path) instead of the default prologue file
1365 overrides this environment variable.
1371 A list of directories in which to search for the
1373 directory in addition to the default ones.
1376 .BR @g@troff (@MAN1EXT@)
1378 .BR \%groff_font (@MAN5EXT@)
1384 .Tp \w'\fB@FONTDIR@/devps/download'u+2n
1385 .B @FONTDIR@/devps/DESC
1386 Device description file.
1389 .BI @FONTDIR@/devps/ F
1390 Font description file for font
1394 .B @FONTDIR@/devps/download
1395 List of downloadable fonts.
1398 .B @FONTDIR@/devps/text.enc
1399 Encoding used for text fonts.
1402 .B @MACRODIR@/ps.tmac
1405 automatically loaded by
1409 .B @MACRODIR@/pspic.tmac
1413 automatically loaded by
1417 .B @MACRODIR@/psold.tmac
1418 Macros to disable use of characters not present in older
1419 PostScript printers (e.g., `eth' or `thorn').
1422 .BI /tmp/grops XXXXXX
1428 .BR \%afmtodit (@MAN1EXT@),
1429 .BR groff (@MAN1EXT@),
1430 .BR @g@troff (@MAN1EXT@),
1431 .BR \%pfbtops (@MAN1EXT@),
1432 .BR \%groff_out (@MAN5EXT@),
1433 .BR \%groff_font (@MAN5EXT@),
1434 .BR \%groff_char (@MAN7EXT@),
1435 .BR \%groff_tmac (@MAN5EXT@)
1438 .UR http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf
1439 PostScript Language Document Structuring Conventions Specification
1443 .\" Local Variables: