4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 Copyright (C) 1989 - 2006, 2008
7 Free Software Foundation, Inc.
9 Permission is granted to make and distribute verbatim copies of
10 this manual provided the copyright notice and this permission notice
11 are preserved on all copies.
13 Permission is granted to copy and distribute modified versions of this
14 manual under the conditions for verbatim copying, provided that the
15 entire resulting derived work is distributed under the terms of a
16 permission notice identical to this one.
18 Permission is granted to copy and distribute translations of this
19 manual into another language, under the above conditions for modified
20 versions, except that this permission notice may be included in
21 translations approved by the Free Software Foundation instead of in
25 .\" Like TP, but if specified indent is more than half
26 .\" the current line-length - indent, use the default indent.
28 . ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
33 . if '\\*(.T'ps' .ft \\$1
36 .TH @U_D_PS@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
41 @L_D_PS@ \- PostScript driver for @T_ROFF@
60 It is possible to have whitespace between a command line option and its
67 translates the output of
71 It should normally be invoked by using the @L_ROFF@ command
76 .if '@DEVICE@'ps' (Actually, this is the default for @T_ROFF@.)
78 If no files are given, the standard input is read.
82 also causes reading of the standard input.
84 PostScript output is written to the standard output.
90 options can be passed to
100 doesn't produce a valid document structure (conforming to the Document
101 Structuring Convention) if called with multiple file arguments.
103 To print such concatenated output it is necessary to deactivate DSC
104 handling in the printing program or previewer.
108 below for a guide how to install fonts for use with
116 Provide workarounds for older printers, broken spoolers, and previewers.
118 Normally output at PostScript LanguageLevel\~2 is produced that conforms
119 to the Document Structuring Conventions version 3.0.
121 Some older printers, spoolers, and previewers can't handle such output.
127 does to make its output acceptable to such programs.
129 A value of\~0 causes @L_D_PS@ not to employ any workarounds.
133 .B %%Begin\%Document\%Setup
135 .B %%End\%Document\%Setup
136 comments should be generated;
137 this is needed for early versions of TranScript that get confused by
140 comment and the first
145 Add\~2 if lines in included files beginning with
147 should be stripped out; this is needed for Sun's pageview previewer.
156 stripped out of included files; this is needed for spoolers that
164 Add\~8 if the first line of the PostScript output should be
168 this is needed when using Sun's Newsprint with a printer that requires
172 Add\~16 if no media size information should be included in the document
173 (this is, neither use
179 This behaviour is needed for older printers which don't understand PostScript
182 It is also necessary if the output is further processed to get an
183 encapsulated PS (EPS) file \[en] see below.
186 The default value can be specified by a
193 command in the DESC file.
195 Otherwise the default value is\~0.
208 to the search path for prologue, font, and device description files;
210 is the name of the device, usually
215 Guess the page length.
217 This generates PostScript code that guesses the page length.
219 The guess is correct only if the imageable area is vertically
220 centered on the page.
222 This option allows you to generate documents that can be printed
223 both on letter (8.5\[mu]11) paper and on A4 paper without change.
227 This option may be used to add a directory to the search path for
228 files on the command line and files named in
229 .B \[rs]X'ps: import'
234 The search path is initialized with the current directory.
236 This option may be specified more than once; the directories are then
237 searched in the order specified (but before the current directory).
239 If you want to make the current directory be read before other directories,
242 at the appropriate place.
245 No directory search is performed for files with an absolute file name.
249 Print the document in landscape format.
253 Turn manual feed on for the document.
257 Set physical dimension of output medium.
266 file; it accepts the same arguments as the
271 .B @L_ROFF@_font (@MAN5EXT@)
275 .BI \-P prologue-file
278 (in the font path) as the prologue instead of the default prologue file
281 This option overrides the environment variable
282 .SM @U_D_PS@_PROLOGUE.
286 Lines should be drawn using a thickness of
288 thousandths of an em.
290 If this option is not given, the line thickness defaults to 0.04\~em.
294 Print the version number.
301 must be in the format output by
302 .BR @L_TROFF@ (@MAN1EXT@).
305 .BR @L_ROFF@_out (@MAN5EXT@).
308 In addition, the device and font description files for the device used
309 must meet certain requirements:
311 The resolution must be an integer multiple of\~72 times the
316 device uses a resolution of 72000 and a sizescale of 1000.
319 The device description file must contain a valid paper size; see
320 .BR @L_ROFF@_font (@MAN5EXT@)
321 for more information.
324 Each font description file must contain a command
326 .BI internalname\ psname
328 which says that the PostScript name of the font is
331 It may also contain a command
333 .BI encoding\ enc_file
336 the PostScript font should be reencoded using the encoding described in
338 this file should consist of a sequence of lines of the form:
345 is the PostScript name of the character,
348 is its position in the encoding expressed as a decimal integer; valid
349 values are in the range 0 to\~255.
353 and blank lines are ignored.
355 The code for each character given in the font file must correspond
356 to the code for the character in encoding file, or to the code in the default
357 encoding for the font if the PostScript font is not to be reencoded.
359 This code can be used with the
363 to select the character,
364 even if the character does not have a @T_ROFF@ name.
366 Every character in the font file must exist in the PostScript font, and
367 the widths given in the font file must match the widths used
368 in the PostScript font.
371 assumes that a character with a @T_ROFF@ name of
373 is blank (makes no marks on the page);
374 it can make use of such a character to generate more efficient and
375 compact PostScript output.
380 is able to display all glyphs in a PostScript font, not only 256.
382 (or the default encoding if no encoding file specified) just defines the
383 order of glyphs for the first 256 characters; all other glyphs are
384 accessed with additional encoding vectors which are produced on the fly.
387 can automatically include the
388 Downloadable fonts necessary to print the document are automatically
391 Such fonts must be in PFA format.
394 .BR \%@L_PFBTOPS@ (@MAN1EXT@)
395 to convert a Type\~1 font in PFB format.
397 Any downloadable fonts which should, when required, be included by
399 must be listed in the file
400 .BR @FONTDIR@/ps/download ;
401 this should consist of lines of the form
410 is the PostScript name of the font,
413 is the name of the file containing the font;
416 and blank lines are ignored;
417 fields may be separated by tabs or spaces;
419 is searched for using the same mechanism that is used
420 for @T_ROFF@ font metric files.
424 file itself is also searched for using this mechanism;
425 currently, only the first found file in the font path is used.
428 If the file containing a downloadable font or imported document
429 conforms to the Adobe Document Structuring Conventions,
432 interprets any comments in the files sufficiently to ensure that its
433 own output is conforming.
435 It also supplies any needed font resources that are listed in the
438 as well as any needed file resources.
440 It is also able to handle inter-resource dependencies.
442 For example, suppose that you have a downloadable font called Garamond,
443 and also a downloadable font called Garamond-Outline
444 which depends on Garamond
445 (typically it would be defined to copy Garamond's font dictionary,
446 and change the PaintType),
447 then it is necessary for Garamond to appear before Garamond-Outline
448 in the PostScript document.
450 This is automatically handled
451 provided that the downloadable font file for Garamond-Outline
452 indicates its dependence on Garamond by means of
453 the Document Structuring Conventions,
454 for example by beginning with the following lines
458 %!PS-Adobe-3.0 Resource-Font
461 %%DocumentNeededResources: font Garamond
467 %%IncludeResource: font Garamond
470 In this case both Garamond and Garamond-Outline would need to be listed
475 A downloadable font should not include its own name in a
476 .B %%Document\%Supplied\%Resources
481 comments are not interpreted.
484 .BR %%Document\%Needed\%Resources ,
485 .BR %%Document\%Supplied\%Resources ,
486 .BR %%Include\%Resource ,
487 .BR %%Begin\%Resource ,
492 .BR %%Document\%Needed\%Fonts ,
493 .BR %%Document\%Supplied\%Fonts ,
494 .BR %%Include\%Font ,
503 there are styles called
509 mounted at font positions 1 to\~4.
511 The fonts are grouped into families
521 having members in each of these styles:
533 AvantGarde-BookOblique
545 AvantGarde-DemiOblique
617 Helvetica-BoldOblique
629 Helvetica-Narrow-Oblique
635 Helvetica-Narrow-Bold
641 Helvetica-Narrow-BoldOblique
647 NewCenturySchlbk-Roman
653 NewCenturySchlbk-Italic
659 NewCenturySchlbk-Bold
665 NewCenturySchlbk-BoldItalic
718 There is also the following font which is not a member of a family:
724 ZapfChancery-MediumItalic
729 There are also some special fonts called
731 for the PS Symbol font, and
733 containing slanted lowercase Greek letters taken from PS Symbol.
735 Zapf Dingbats is available as
737 and a reversed version of ZapfDingbats (with symbols pointing in the opposite
738 direction) is available as
740 most characters in these fonts are unnamed and must be accessed using
744 The default color for
748 is black; for colors defined in the `rgb' color space
750 is used, for `cmy' and `cmyk'
757 is a PostScript LanguageLevel\~2 command and thus not available on some
761 Various X\~commands produced using the
763 escape sequence are understood, of which only commands that begin with a
768 .BI \[rs]X'ps:\ exec\ code '
769 This executes the arbitrary PostScript commands in
772 The PostScript currentpoint is set to the position of the
774 command before executing
777 The origin is at the top left corner of the page,
778 and y\~coordinates increase down the page.
782 is defined that converts @T_ROFF@ units
783 to the coordinate system in effect (provided the user doesn't change the
794 \[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
799 draws a horizontal line one inch long.
802 may make changes to the graphics state,
803 but any changes persist only to the end of the page.
805 A dictionary containing the definitions specified by the
809 is on top of the dictionary stack.
811 If your code adds definitions to this dictionary,
812 you should allocate space for them using
813 .BI \[rs]X'ps\ mdef \ n '\fR.
815 Any definitions persist only until the end of the page.
819 escape sequence with an argument that names a macro,
821 can extend over multiple lines.
832 \&\[rs]nx u 0 rlineto
840 is another way to draw a horizontal line one inch long.
842 Note the single backslash before `nx' \[en] the only reason to use a number
843 register while defining the macro `y' is to convert a user-specified
844 dimension `1i' to internal @T_ROFF@ units which are in turn converted to PS
851 wraps user-specified PostScript code into a dictionary, nothing more.
853 In particular, it doesn't start and end the inserted code with
859 This must be supplied by the user, if necessary.
864 .BI \[rs]X'ps:\ file\ name '
865 This is the same as the
867 command except that the PostScript code is read from file
871 .BI \[rs]X'ps:\ def\ code '
872 Place a PostScript definition contained in
876 There should be at most one definition per
880 Long definitions can be split over several
885 arguments are simply joined together separated by newlines.
887 The definitions are placed in a dictionary which is automatically
888 pushed on the dictionary stack when an
894 escape sequence with an argument that names a macro,
896 can extend over multiple lines.
899 .BI \[rs]X'ps:\ mdef\ n\ code '
909 needs to know how many definitions
912 so that it can create an appropriately sized PostScript dictionary
916 .BI \[rs]X'ps:\ import\ file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
917 Import a PostScript graphic from
926 give the bounding box of the graphic in the default PostScript
927 coordinate system; they should all be integers;
931 are the x and y\~coordinates of the lower left
932 corner of the graphic;
936 are the x and y\~coordinates of the upper right corner of the graphic;
940 are integers that give the desired width and height in @T_ROFF@
941 units of the graphic.
944 The graphic is scaled so that it has this width and height
945 and translated so that the lower left corner of the graphic is
946 located at the position associated with
950 If the height argument is omitted it is scaled uniformly in the
951 x and y\~directions so that it has the specified width.
954 Note that the contents of the
956 command are not interpreted by
958 so vertical space for the graphic is not automatically added,
963 arguments are not allowed to have attached scaling indicators.
966 If the PostScript file complies with the Adobe Document Structuring
967 Conventions and contains a
969 comment, then the bounding box can be automatically
970 extracted from within @T_ROFF@ by using the
976 .BR @L_ROFF@_tmac (@MAN5EXT@)
977 for a description of the
979 macro which provides a convenient high-level interface for inclusion of
983 .B \[rs]X'ps:\ invis'
985 .B \[rs]X'ps:\ endinvis'
986 No output is generated for text and drawing commands
987 that are bracketed with these
991 These commands are intended for use when output from
993 is previewed before being processed with
995 if the previewer is unable to display certain characters
996 or other constructs, then other substitute characters or constructs
997 can be used for previewing by bracketing them with these
1004 If a PostScript procedure
1006 has been defined via a
1010 device command, it is executed at the beginning
1011 of every page (before anything is drawn or written).
1012 For example, to underlay the page contents with the word
1013 `DRAFT' in light gray, you might use
1021 { gsave .9 setgray clippath pathbbox exch 2 copy
1022 .5 mul exch .5 mul translate atan rotate pop pop
1023 /NewCenturySchlbk-Roman findfont 200 scalefont setfont
1024 (DRAFT) dup stringwidth pop \-.5 mul \-70 moveto show
1033 Or, to cause lines and polygons to be drawn with square linecaps
1034 and mitered linejoins instead of the round linecaps and linejoins
1044 /BPhook { 2 setlinecap 0 setlinejoin } def
1051 (square linecaps, as opposed to butt linecaps (0 setlinecap),
1052 give true corners in boxed tables even though the lines are
1056 .SS Encapsulated PostScript
1058 itself doesn't emit bounding box information.
1060 With the help of Ghostscript the following simple script,
1062 produces an encapsulated PS file.
1069 @L_ROFF@ \-P\-b16 "${1} > "${1}.ps"
1070 trap "rm -f \e"${1}.ps\e"; exit" 0 1 2 15
1071 gs \-dNOPAUSE \-sDEVICE=bbox \-\- "${1}.ps" 2> "${1}.bbox"
1072 trap "rm -f \e"${1}.ps\e" \e"${1}.bbox\e"; exit" 0 1 2 15
1073 < "${1}.ps" sed \-e "/\[ha]%%Orientation/r ${1}.bbox" \[rs]
1074 \-e '/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/' > "${1}.eps"
1093 .SS TrueType and other font formats
1094 TrueType fonts can be used with
1096 if converted first to
1098 format, a special PostScript wrapper equivalent to the
1099 PFA format mentioned in
1100 .BR \%@L_PFBTOPS@ (@MAN1EXT@).
1102 There are several different methods to generate a type42
1103 wrapper and most of them involve the use of a PostScript
1104 interpreter such as Ghostscript \[en] see
1108 Yet, the easiest method involves the use of the application
1113 (version 1.3.1) to generate type42
1114 font wrappers and well-formed AFM files that can be fed to
1116 .BR \%@L_AFMTODIT@ (@MAN1EXT@)
1117 script to create appropriate metric files.
1119 The resulting font wrappers should be added to the
1123 source code can be downloaded from
1124 .UR ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1125 ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1129 Another solution for creating type42 wrappers is to use FontForge,
1131 .UR http://\:fontforge.sf.net
1132 http://\:fontforge.sf.net
1134 This font editor can convert most outline font formats.
1137 .SH FONT INSTALLATION
1139 This section gives a summary of the above explanations; it can serve
1140 as a step-by-step font installation guide.
1145 \h'-\w'\*[BU]'u'\*[BU]\c
1148 Convert your font to something @T_ROFF@ understands.
1150 This is either a PostScript Type\~1 font in PFA format or a
1151 PostScript Type\~42 font, together with an AFM file.
1154 The very first characters in a PFA file look like this:
1158 .B %!PS-AdobeFont-1.0:
1162 A PFB file has this also in the first line, but the string is
1163 preceded with some binary bytes.
1166 The very first characters in a Type\~42 font file look like this:
1170 .B %!PS-TrueTypeFont
1174 This is a wrapper format for TrueType fonts.
1176 Old PS printers might not support it (this is, they don't have a
1177 built-in TrueType font interpreter).
1180 If your font is in PFB format (such fonts normally have `.pfb' as
1181 the file extension), you might use
1182 .BR \%@L_PFBTOPS@ (@MAN1EXT@)
1183 program to convert it to PFA.
1185 For TrueType fonts, try
1189 For all other font formats use
1191 which can convert most outline font formats.
1194 Convert the AFM file to a font description file with the
1195 .BR \%@L_AFMTODIT@ (@MAN1EXT@)
1202 @L_AFMTODIT@ Foo-Bar-Bold.afm textmap FBB
1206 which converts the metric file `Foo-Bar-Bold.afm' to the @T_ROFF@
1209 If you have a font family which comes with normal, bold, italic,
1210 and bold italic faces, it is recommended to use the letters
1216 respectively, as postfixes in the @T_ROFF@ font names to make the
1217 `.fam' request work.
1219 An example is the built-in Times-Roman font: The font family name
1222 and the font names are
1230 Install both the font description files and the fonts in a
1231 `devps' subdirectory of the font path which @T_ROFF@ can find.
1236 .BR @L_TROFF@ (@MAN1EXT@)
1237 man page which lists the actual value of the font path.
1239 Note that @T_ROFF@ doesn't use the AFM files (but it is a good idea to
1243 Register all fonts which must be downloaded to the printer in the
1244 `devps/download' file.
1246 Only the first occurrence of this file in the font path is read.
1248 This means that you should copy the default `download' file to the
1249 first directory in your font path and add your fonts there.
1251 To continue the above example we assume that the PS font name for
1252 Foo-Bar-Bold.pfa is `XY-Foo-Bar-Bold' (the PS font name is stored in the
1254 field in the `FBB' file), thus the following line should be added to
1259 .B XY-Foo-Bar-Bold Foo-Bar-Bold.pfa
1268 .B @U_D_PS@_PROLOGUE
1275 (in the font path) instead of the default prologue file
1280 overrides this environment variable.
1285 .B @U_ROFF@_FONT_PATH
1286 A list of directories in which to search for the
1288 directory in addition to the default ones.
1291 .BR @L_TROFF@ (@MAN1EXT@)
1293 .BR \%@L_ROFF@_font (@MAN5EXT@)
1299 .Tp \w'\fB@FONTDIR@/ps/download'u+2n
1300 .B @FONTDIR@/ps/DESC
1301 Device description file.
1305 Font description file for font
1309 .B @FONTDIR@/ps/download
1310 List of downloadable fonts.
1313 .B @FONTDIR@/ps/text.enc
1314 Encoding used for text fonts.
1317 .B @MACRODIR@/ps.tmac
1320 automatically loaded by
1324 .B @MACRODIR@/pspic.tmac
1328 automatically loaded by
1332 .B @MACRODIR@/psold.tmac
1333 Macros to disable use of characters not present in older
1334 PostScript printers (e.g., `eth' or `thorn').
1339 .BR \%@L_AFMTODIT@ (@MAN1EXT@),
1340 .BR @L_ROFF@ (@MAN1EXT@),
1341 .BR @L_TROFF@ (@MAN1EXT@),
1342 .BR \%@L_PFBTOPS@ (@MAN1EXT@),
1343 .BR \%@L_ROFF@_out (@MAN5EXT@),
1344 .BR \%@L_ROFF@_font (@MAN5EXT@),
1345 .BR \%@L_ROFF@_char (@MAN7EXT@),
1346 .BR \%@L_ROFF@_tmac (@MAN5EXT@)
1349 .UR http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf
1350 PostScript Language Document Structuring Conventions Specification