Merge branch 'topic/sync-to-go-2'
[s-roff.git] / man / dev-ps.1.in
blobe8f7a6d03bd553fc49de240adc81bbbaf0093050
1 .ig
2 @ @L_D_PS@.1
4 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
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
22 the original English.
25 .do nr __compat \n[.C]
26 .cp 0
28 .\" Like TP, but if specified indent is more than half
29 .\" the current line-length - indent, use the default indent.
30 .de Tp
31 .  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
32 .  el .TP "\\$1"
35 .de FT
36 .  ie '\\*(.T'ps' .ft \\$1
37 .  el .if '\\*(.T'pdf' .ft \\$1
40 .TH @U_D_PS@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
43 .SH NAME
45 @L_D_PS@ \- PostScript driver for @T_ROFF@
48 .SH SYNOPSIS
50 .SY @L_D_PS@
51 .OP \-glmv
52 .OP \-b n
53 .OP \-c n
54 .OP \-F dir
55 .OP \-I dir
56 .OP \-p papersize
57 .OP \-P prologue
58 .OP \-w n
59 .RI [ files
60 .IR .\|.\|. ]
61 .YS
63 .LP
64 It is possible to have whitespace between a command line option and its
65 parameter.
68 .SH DESCRIPTION
70 .B @L_D_PS@
71 translates the output of
72 .B @L_TROFF@
73 to PostScript.
75 It should normally be invoked by using the @L_ROFF@ command
76 with a
77 .B \-Tps
78 option.
80 .if '@DEVICE@'ps' (Actually, this is the default for @T_ROFF@.)
82 If no files are given, the standard input is read.
84 A filename of
85 .B \-
86 also causes reading of the standard input.
88 PostScript output is written to the standard output.
90 When
91 .B @L_D_PS@
92 is run by
93 .B @L_ROFF@
94 options can be passed to
95 .B @L_D_PS@
96 using
97 .BR @L_ROFF@ 's
98 .B \-P
99 option.
102 Note that
103 .B @L_D_PS@
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.
110 See section
111 .B FONT INSTALLATION
112 below for a guide how to install fonts for use with
113 .BR @L_D_PS@ .
116 .SH OPTIONS
119 .BI \-b n
120 Provide workarounds for older printers, broken spoolers, and previewers.
122 Normally output at PostScript LanguageLevel\~2 is produced that conforms
123 to the Document Structuring Conventions version 3.0.
125 Some older printers, spoolers, and previewers can't handle such output.
127 The value of\~\c
128 .I n
129 controls what
130 .B @L_D_PS@
131 does to make its output acceptable to such programs.
133 A value of\~0 causes @L_D_PS@ not to employ any workarounds.
136 Add\~1 if no
137 .B %%Begin\%Document\%Setup
139 .B %%End\%Document\%Setup
140 comments should be generated;
141 this is needed for early versions of TranScript that get confused by
142 anything between the
143 .B %%End\%Prolog
144 comment and the first
145 .B %%Page
146 comment.
149 Add\~2 if lines in included files beginning with
150 .B %!\&
151 should be stripped out; this is needed for Sun's pageview previewer.
154 Add\~4 if
155 .BR %%Page ,
156 .BR %%Trailer
158 .B %%End\%Prolog
159 comments should be
160 stripped out of included files; this is needed for spoolers that
161 don't understand the
162 .B %%Begin\%Document
164 .B %%End\%Document
165 comments.
168 Add\~8 if the first line of the PostScript output should be
169 .B %!PS-Adobe-2.0
170 rather than
171 .BR %!PS-Adobe-3.0 ;
172 this is needed when using Sun's Newsprint with a printer that requires
173 page reversal.
176 Add\~16 if no media size information should be included in the document
177 (this is, neither use
178 .B %%Document\%Media
179 nor the
180 .B setpagedevice
181 PostScript command).
183 This behaviour is needed for older printers which don't understand PostScript
184 LanguageLevel\~2.
186 It is also necessary if the output is further processed to get an
187 encapsulated PS (EPS) file \[en] see below.
190 The default value can be specified by a
194 .BI broken\  n
197 command in the DESC file.
199 Otherwise the default value is\~0.
203 .BI \-c n
204 Print
205 .I n
206 copies of each page.
209 .BI \-F dir
210 Prepend directory
211 .IB dir /dev name
212 to the search path for prologue, font, and device description files;
213 .I name
214 is the name of the device, usually
215 .BR ps .
218 .BI \-g
219 Guess the page length.
221 This generates PostScript code that guesses the page length.
223 The guess is correct only if the imageable area is vertically
224 centered on the page.
226 This option allows you to generate documents that can be printed
227 both on letter (8.5\[mu]11) paper and on A4 paper without change.
230 .BI \-I dir
231 This option may be used to add a directory to the search path for
232 files on the command line and files named in
233 .B \[rs]X'ps: import'
235 .B \[rs]X'ps: file'
236 escapes.
238 The search path is initialized with the current directory.
240 This option may be specified more than once; the directories are then
241 searched in the order specified (but before the current directory).
243 If you want to make the current directory be read before other directories,
245 .B \-I.\&
246 at the appropriate place.
249 No directory search is performed for files with an absolute file name.
252 .B \-l
253 Print the document in landscape format.
256 .B \-m
257 Turn manual feed on for the document.
260 .BI \-p paper-size
261 Set physical dimension of output medium.
263 This overrides the
264 .BR papersize ,
265 .BR paperlength ,
267 .B paperwidth
268 commands in the
269 .B DESC
270 file; it accepts the same arguments as the
271 .B papersize
272 command.
275 .B @L_ROFF@-font (@MAN5EXT@)
276 for details.
279 .BI \-P prologue-file
280 Use the file
281 .I prologue-file
282 (in the font path) as the prologue instead of the default prologue file
283 .BR prologue .
285 This option overrides the environment variable
286 .SM @U_D_PS@_PROLOGUE.
289 .BI \-w n
290 Lines should be drawn using a thickness of
291 .IR n \~\c
292 thousandths of an em.
294 If this option is not given, the line thickness defaults to 0.04\~em.
297 .B \-v
298 Print the version number.
301 .SH USAGE
303 The input to
304 .B @L_D_PS@
305 must be in the format output by
306 .BR @L_TROFF@ (@MAN1EXT@).
308 This is described in
309 .BR @L_ROFF@-out (@MAN5EXT@).
312 In addition, the device and font description files for the device used
313 must meet certain requirements:
315 The resolution must be an integer multiple of\~72 times the
316 .BR sizescale .
319 .B ps
320 device uses a resolution of 72000 and a sizescale of 1000.
323 The device description file must contain a valid paper size; see
324 .BR @L_ROFF@-font (@MAN5EXT@)
325 for more information.
328 Each font description file must contain a command
330 .BI internalname\  psname
332 which says that the PostScript name of the font is
333 .IR psname .
335 It may also contain a command
337 .BI encoding\  enc_file
339 which says that
340 the PostScript font should be reencoded using the encoding described in
341 .IR enc_file ;
342 this file should consist of a sequence of lines of the form:
345 pschar code
347 where
348 .I pschar
349 is the PostScript name of the character,
351 .I code
352 is its position in the encoding expressed as a decimal integer; valid
353 values are in the range 0 to\~255.
355 Lines starting with
356 .B #
357 and blank lines are ignored.
359 The code for each character given in the font file must correspond
360 to the code for the character in encoding file, or to the code in the default
361 encoding for the font if the PostScript font is not to be reencoded.
363 This code can be used with the
364 .B \[rs]N
365 escape sequence in
366 .B troff
367 to select the character,
368 even if the character does not have a @T_ROFF@ name.
370 Every character in the font file must exist in the PostScript font, and
371 the widths given in the font file must match the widths used
372 in the PostScript font.
374 .B @L_D_PS@
375 assumes that a character with a @T_ROFF@ name of
376 .B space
377 is blank (makes no marks on the page);
378 it can make use of such a character to generate more efficient and
379 compact PostScript output.
382 Note that
383 .B @L_D_PS@
384 is able to display all glyphs in a PostScript font, not only 256.
385 .I enc_file
386 (or the default encoding if no encoding file specified) just defines the
387 order of glyphs for the first 256 characters; all other glyphs are
388 accessed with additional encoding vectors which are produced on the fly.
391 can automatically include the
392 Downloadable fonts necessary to print the document are automatically
393 downloaded.
395 Such fonts must be in PFA format.
398 .BR \%@L_PFBTOPS@ (@MAN1EXT@)
399 to convert a Type\~1 font in PFB format.
401 Any downloadable fonts which should, when required, be included by
402 .B @L_D_PS@
403 must be listed in the file
404 .BR @FONTDIR@/ps/download ;
405 this should consist of lines of the form
409 font filename
412 where
413 .I font
414 is the PostScript name of the font,
416 .I filename
417 is the name of the file containing the font;
418 lines beginning with
419 .B #
420 and blank lines are ignored;
421 fields may be separated by tabs or spaces;
422 .I filename
423 is searched for using the same mechanism that is used
424 for @T_ROFF@ font metric files.
427 .B download
428 file itself is also searched for using this mechanism;
429 currently, only the first found file in the font path is used.
432 If the file containing a downloadable font or imported document
433 conforms to the Adobe Document Structuring Conventions,
434 then
435 .B @L_D_PS@
436 interprets any comments in the files sufficiently to ensure that its
437 own output is conforming.
439 It also supplies any needed font resources that are listed in the
440 .B download
441 file
442 as well as any needed file resources.
444 It is also able to handle inter-resource dependencies.
446 For example, suppose that you have a downloadable font called Garamond,
447 and also a downloadable font called Garamond-Outline
448 which depends on Garamond
449 (typically it would be defined to copy Garamond's font dictionary,
450 and change the PaintType),
451 then it is necessary for Garamond to appear before Garamond-Outline
452 in the PostScript document.
454 This is automatically handled
455 provided that the downloadable font file for Garamond-Outline
456 indicates its dependence on Garamond by means of
457 the Document Structuring Conventions,
458 for example by beginning with the following lines
462 %!PS-Adobe-3.0 Resource-Font
465 %%DocumentNeededResources: font Garamond
468 %%EndComments
471 %%IncludeResource: Font Garamond
474 In this case both Garamond and Garamond-Outline would need to be listed
475 in the
476 .B download
477 file.
479 A downloadable font should not include its own name in a
480 .B %%Document\%Supplied\%Resources
481 comment.
484 .B %%Document\%Fonts
485 comments are not interpreted.
488 .BR %%Document\%Needed\%Resources ,
489 .BR %%Document\%Supplied\%Resources ,
490 .BR %%Include\%Resource ,
491 .BR %%Begin\%Resource ,
493 .BR %%End\%Resource
494 comments
495 (or possibly the old
496 .BR %%Document\%Needed\%Fonts ,
497 .BR %%Document\%Supplied\%Fonts ,
498 .BR %%Include\%Font ,
499 .BR %%Begin\%Font ,
501 .BR %%End\%Font
502 comments)
503 should be used.
506 In the default setup
507 there are styles called
508 .BR R ,
509 .BR I ,
510 .BR B ,
512 .B BI
513 mounted at font positions 1 to\~4.
515 The fonts are grouped into families
516 .BR A ,
517 .BR BM ,
518 .BR C ,
519 .BR H ,
520 .BR HN ,
521 .BR N ,
522 .BR P ,
523 and\~\c
524 .B T
525 having members in each of these styles:
529 .B AR
530 .FT AR
531 AvantGarde-Book
535 .B AI
536 .FT AI
537 AvantGarde-BookOblique
541 .B AB
542 .FT AB
543 AvantGarde-Demi
547 .B ABI
548 .FT ABI
549 AvantGarde-DemiOblique
553 .B BMR
554 .FT BMR
555 Bookman-Light
559 .B BMI
560 .FT BMI
561 Bookman-LightItalic
565 .B BMB
566 .FT BMB
567 Bookman-Demi
571 .B BMBI
572 .FT BMBI
573 Bookman-DemiItalic
577 .B CR
578 .FT CR
579 Courier
583 .B CI
584 .FT CI
585 Courier-Oblique
589 .B CB
590 .FT CB
591 Courier-Bold
595 .B CBI
596 .FT CBI
597 Courier-BoldOblique
601 .B HR
602 .FT HR
603 Helvetica
607 .B HI
608 .FT HI
609 Helvetica-Oblique
613 .B HB
614 .FT HB
615 Helvetica-Bold
619 .B HBI
620 .FT HBI
621 Helvetica-BoldOblique
625 .B HNR
626 .FT HNR
627 Helvetica-Narrow
631 .B HNI
632 .FT HNI
633 Helvetica-Narrow-Oblique
637 .B HNB
638 .FT HNB
639 Helvetica-Narrow-Bold
643 .B HNBI
644 .FT HNBI
645 Helvetica-Narrow-BoldOblique
649 .B NR
650 .FT NR
651 NewCenturySchlbk-Roman
655 .B NI
656 .FT NI
657 NewCenturySchlbk-Italic
661 .B NB
662 .FT NB
663 NewCenturySchlbk-Bold
667 .B NBI
668 .FT NBI
669 NewCenturySchlbk-BoldItalic
673 .B PR
674 .FT PR
675 Palatino-Roman
679 .B PI
680 .FT PI
681 Palatino-Italic
685 .B PB
686 .FT PB
687 Palatino-Bold
691 .B PBI
692 .FT PBI
693 Palatino-BoldItalic
697 .B TR
698 .FT TR
699 Times-Roman
703 .B TI
704 .FT TI
705 Times-Italic
709 .B TB
710 .FT TB
711 Times-Bold
715 .B TBI
716 .FT TBI
717 Times-BoldItalic
722 There is also the following font which is not a member of a family:
726 .B ZCMI
727 .FT ZCMI
728 ZapfChancery-MediumItalic
733 There are also some special fonts called
734 .B S
735 for the PS Symbol font, and
736 .BR SS ,
737 containing slanted lowercase Greek letters taken from PS Symbol.
739 Zapf Dingbats is available as
740 .BR ZD ,
741 and a reversed version of ZapfDingbats (with symbols pointing in the opposite
742 direction) is available as
743 .BR ZDR ;
744 most characters in these fonts are unnamed and must be accessed using
745 .BR \[rs]N .
748 The default color for
749 .B \[rs]m
751 .B \[rs]M
752 is black; for colors defined in the `rgb' color space
753 .B setrgbcolor
754 is used, for `cmy' and `cmyk'
755 .BR setcmykcolor ,
756 and for `gray'
757 .BR setgray .
759 Note that
760 .B setcmykcolor
761 is a PostScript LanguageLevel\~2 command and thus not available on some
762 older printers.
765 Various X\~commands produced using the
766 .B \[rs]X
767 escape sequence are understood, of which only commands that begin with a
768 .B ps:
769 tag are interpreted.
772 .BI \[rs]X'ps:\ exec\  code '
773 This executes the arbitrary PostScript commands in
774 .IR code .
776 The PostScript currentpoint is set to the position of the
777 .B \[rs]X
778 command before executing
779 .IR code .
781 The origin is at the top left corner of the page,
782 and y\~coordinates increase down the page.
784 A procedure\~\c
785 .B u
786 is defined that converts @T_ROFF@ units
787 to the coordinate system in effect (provided the user doesn't change the
788 scale).
790 For example,
795 \&.nr x 1i
798 \[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
803 draws a horizontal line one inch long.
805 .I code
806 may make changes to the graphics state,
807 but any changes persist only to the end of the page.
809 A dictionary containing the definitions specified by the
810 .B def
812 .B mdef
813 is on top of the dictionary stack.
815 If your code adds definitions to this dictionary,
816 you should allocate space for them using
817 .BI \[rs]X'ps\ mdef \ n '\fR.
819 Any definitions persist only until the end of the page.
821 If you use the
822 .B \[rs]Y
823 escape sequence with an argument that names a macro,
824 .I code
825 can extend over multiple lines.
827 For example,
832 .ft B
833 \&.nr x 1i
834 \&.de y
835 \&ps: exec
836 \&\[rs]nx u 0 rlineto
837 \&stroke
838 \&..
839 \&\[rs]Yy
840 .ft R
844 is another way to draw a horizontal line one inch long.
846 Note the single backslash before `nx' \[en] the only reason to use a number
847 register while defining the macro `y' is to convert a user-specified
848 dimension `1i' to internal @T_ROFF@ units which are in turn converted to PS
849 units with the
850 .B u
851 procedure.
854 .B @L_D_PS@
855 wraps user-specified PostScript code into a dictionary, nothing more.
857 In particular, it doesn't start and end the inserted code with
858 .B save
860 .BR restore ,
861 respectively.
863 This must be supplied by the user, if necessary.
868 .BI \[rs]X'ps:\ file\  name '
869 This is the same as the
870 .B exec
871 command except that the PostScript code is read from file
872 .IR name .
875 .BI \[rs]X'ps:\ def\  code '
876 Place a PostScript definition contained in
877 .I code
878 in the prologue.
880 There should be at most one definition per
881 .B \[rs]X
882 command.
884 Long definitions can be split over several
885 .B \[rs]X
886 commands;
887 all the
888 .I code
889 arguments are simply joined together separated by newlines.
891 The definitions are placed in a dictionary which is automatically
892 pushed on the dictionary stack when an
893 .B exec
894 command is executed.
896 If you use the
897 .B \[rs]Y
898 escape sequence with an argument that names a macro,
899 .I code
900 can extend over multiple lines.
903 .BI \[rs]X'ps:\ mdef\  n\ code  '
904 Like
905 .BR def ,
906 except that
907 .I code
908 may contain up to
909 .IR n \~\c
910 definitions.
912 .B @L_D_PS@
913 needs to know how many definitions
914 .I code
915 contains
916 so that it can create an appropriately sized PostScript dictionary
917 to contain them.
920 .BI \[rs]X'ps:\ import\  file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
921 Import a PostScript graphic from
922 .IR file .
924 The arguments
925 .IR llx ,
926 .IR lly ,
927 .IR urx ,
929 .I ury
930 give the bounding box of the graphic in the default PostScript
931 coordinate system; they should all be integers;
932 .I llx
934 .I lly
935 are the x and y\~coordinates of the lower left
936 corner of the graphic;
937 .I urx
939 .I ury
940 are the x and y\~coordinates of the upper right corner of the graphic;
941 .I width
943 .I height
944 are integers that give the desired width and height in @T_ROFF@
945 units of the graphic.
948 The graphic is scaled so that it has this width and height
949 and translated so that the lower left corner of the graphic is
950 located at the position associated with
951 .B \[rs]X
952 command.
954 If the height argument is omitted it is scaled uniformly in the
955 x and y\~directions so that it has the specified width.
958 Note that the contents of the
959 .B \[rs]X
960 command are not interpreted by
961 .BR troff ;
962 so vertical space for the graphic is not automatically added,
963 and the
964 .I width
966 .I height
967 arguments are not allowed to have attached scaling indicators.
970 If the PostScript file complies with the Adobe Document Structuring
971 Conventions and contains a
972 .B %%Bounding\%Box
973 comment, then the bounding box can be automatically
974 extracted from within @T_ROFF@ by using the
975 .B psbb
976 request.
980 .BR @L_ROFF@-tmac (@MAN5EXT@)
981 for a description of the
982 .B PSPIC
983 macro which provides a convenient high-level interface for inclusion of
984 PostScript graphics.
987 .B \[rs]X'ps:\ invis'
989 .B \[rs]X'ps:\ endinvis'
990 No output is generated for text and drawing commands
991 that are bracketed with these
992 .B \[rs]X
993 commands.
995 These commands are intended for use when output from
996 .B troff
997 is previewed before being processed with
998 .BR @L_D_PS@ ;
999 if the previewer is unable to display certain characters
1000 or other constructs, then other substitute characters or constructs
1001 can be used for previewing by bracketing them with these
1002 .B \[rs]X
1003 commands.
1008 If a PostScript procedure
1009 .B BPhook
1010 has been defined via a
1011 .RB ` ps:\ def '
1013 .RB ` ps:\ mdef '
1014 device command, it is executed at the beginning
1015 of every page (before anything is drawn or written).
1016 For example, to underlay the page contents with the word
1017 `DRAFT' in light gray, you might use
1021 .ft B
1022 \&.de XX
1023 ps: def
1024 /BPhook
1025 { gsave .9 setgray clippath pathbbox exch 2 copy
1026   .5 mul exch .5 mul translate atan rotate pop pop
1027   /NewCenturySchlbk-Roman findfont 200 scalefont setfont
1028   (DRAFT) dup stringwidth pop \-.5 mul \-70 moveto show
1029   grestore }
1031 \&..
1032 \&.devicem XX
1033 .ft R
1037 Or, to cause lines and polygons to be drawn with square linecaps
1038 and mitered linejoins instead of the round linecaps and linejoins
1039 normally used by
1040 .BR @L_D_PS@ ,
1045 .ft B
1046 \&.de XX
1047 ps: def
1048 /BPhook { 2 setlinecap 0 setlinejoin } def
1049 \&..
1050 \&.devicem XX
1051 .ft R
1055 (square linecaps, as opposed to butt linecaps (0 setlinecap),
1056 give true corners in boxed tables even though the lines are
1057 drawn unconnected).
1060 .SS Encapsulated PostScript
1061 .B @L_D_PS@
1062 itself doesn't emit bounding box information.
1064 With the help of Ghostscript the following simple script,
1065 .BR @L_ROFF@2eps ,
1066 produces an encapsulated PS file.
1071 .ft B
1072 #!/bin/sh
1073 @L_ROFF@ \-P\-b16 "${1} > "${1}.ps"
1074 trap "rm -f \e"${1}.ps\e"; exit" 0 1 2 15
1075 gs \-dNOPAUSE \-sDEVICE=bbox \-\- "${1}.ps" 2> "${1}.bbox"
1076 trap "rm -f \e"${1}.ps\e" \e"${1}.bbox\e"; exit" 0 1 2 15
1077 < "${1}.ps" sed \-e "/\[ha]%%Orientation/r ${1}.bbox" \[rs]
1078     \-e '/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/' > "${1}.eps"
1079 .ft R
1084 Just say
1088 @L_ROFF@2eps foo
1091 to convert file
1092 .B foo
1094 .BR foo.eps .
1097 .SS TrueType and other font formats
1098 TrueType fonts can be used with
1099 .B @L_D_PS@
1100 if converted first to
1101 .B "Type\~42"
1102 format, a special PostScript wrapper equivalent to the
1103 PFA format mentioned in
1104 .BR \%@L_PFBTOPS@ (@MAN1EXT@).
1106 There are several different methods to generate a type42
1107 wrapper and most of them involve the use of a PostScript
1108 interpreter such as Ghostscript \[en] see
1109 .BR gs (1).
1112 Yet, the easiest method involves the use of the application
1113 .BR ttftot42 (1).
1115 This program uses
1116 .BR freetype (3)
1117 (version 1.3.1) to generate type42
1118 font wrappers and well-formed AFM files that can be fed to
1120 .BR \%@L_AFMTODIT@ (@MAN1EXT@)
1121 script to create appropriate metric files.
1123 The resulting font wrappers should be added to the
1124 .B download
1125 file.
1126 .B ttftot42
1127 source code can be downloaded from
1128 .UR ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1129 ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/
1130 .UE .
1133 Another solution for creating type42 wrappers is to use FontForge,
1134 available from
1135 .UR http://\:fontforge.sf.net
1136 http://\:fontforge.sf.net
1137 .UE .
1138 This font editor can convert most outline font formats.
1141 .SH FONT INSTALLATION
1143 This section gives a summary of the above explanations; it can serve
1144 as a step-by-step font installation guide.
1146 .ds BU \[bu]\ \ \"
1147 .de LI
1148 .IP "" 4
1149 \h'-\w'\*[BU]'u'\*[BU]\c
1152 Convert your font to something @T_ROFF@ understands.
1154 This is either a PostScript Type\~1 font in PFA format or a
1155 PostScript Type\~42 font, together with an AFM file.
1158 The very first characters in a PFA file look like this:
1162 .B %!PS-AdobeFont-1.0:
1166 A PFB file has this also in the first line, but the string is
1167 preceded with some binary bytes.
1170 The very first characters in a Type\~42 font file look like this:
1174 .B %!PS-TrueTypeFont
1178 This is a wrapper format for TrueType fonts.
1180 Old PS printers might not support it (this is, they don't have a
1181 built-in TrueType font interpreter).
1184 If your font is in PFB format (such fonts normally have `.pfb' as
1185 the file extension), you might use
1186 .BR \%@L_PFBTOPS@ (@MAN1EXT@)
1187 program to convert it to PFA.
1189 For TrueType fonts, try
1190 .B ttftot42
1192 .BR fontforge .
1193 For all other font formats use
1194 .B fontforge
1195 which can convert most outline font formats.
1198 Convert the AFM file to a font description file with the
1199 .BR \%@L_AFMTODIT@ (@MAN1EXT@)
1200 program.
1202 An example call is
1206 @L_AFMTODIT@ Foo-Bar-Bold.afm textmap FBB
1210 which converts the metric file `Foo-Bar-Bold.afm' to the @T_ROFF@
1211 font `FBB'.
1213 If you have a font family which comes with normal, bold, italic,
1214 and bold italic faces, it is recommended to use the letters
1215 .BR R ,
1216 .BR B ,
1217 .BR I ,
1219 .BR BI ,
1220 respectively, as postfixes in the @T_ROFF@ font names to make the
1221 `.fam' request work.
1223 An example is the built-in Times-Roman font: The font family name
1225 .BR T ,
1226 and the font names are
1227 .BR TR ,
1228 .BR TB ,
1229 .BR TI ,
1231 .BR TBI .
1234 Install both the font description files and the fonts in a
1235 `devps' subdirectory of the font path which @T_ROFF@ can find.
1237 See the
1238 .B ENVIRONMENT
1239 section in the
1240 .BR @L_TROFF@ (@MAN1EXT@)
1241 man page which lists the actual value of the font path.
1243 Note that @T_ROFF@ doesn't use the AFM files (but it is a good idea to
1244 store them anyway).
1247 Register all fonts which must be downloaded to the printer in the
1248 `devps/download' file.
1250 Only the first occurrence of this file in the font path is read.
1252 This means that you should copy the default `download' file to the
1253 first directory in your font path and add your fonts there.
1255 To continue the above example we assume that the PS font name for
1256 Foo-Bar-Bold.pfa is `XY-Foo-Bar-Bold' (the PS font name is stored in the
1257 .B internalname
1258 field in the `FBB' file), thus the following line should be added to
1259 `download'.
1263 .B XY-Foo-Bar-Bold Foo-Bar-Bold.pfa
1268 .SH ENVIRONMENT
1272 .B @U_D_PS@_PROLOGUE
1273 If this is set to
1274 .IR foo ,
1275 then
1276 .B @L_D_PS@
1277 uses the file
1278 .I foo
1279 (in the font path) instead of the default prologue file
1280 .BR prologue .
1282 The option
1283 .B \-P
1284 overrides this environment variable.
1289 .B @U_ROFF@_FONT_PATH
1290 A list of directories in which to search for the
1291 .BI dev name
1292 directory in addition to the default ones.
1295 .BR @L_TROFF@ (@MAN1EXT@)
1297 .BR \%@L_ROFF@-font (@MAN5EXT@)
1298 for more details.
1301 .SH FILES
1303 .Tp \w'\fB@FONTDIR@/ps/download'u+2n
1304 .B @FONTDIR@/ps/DESC
1305 Device description file.
1308 .BI @FONTDIR@/ps/ F
1309 Font description file for font
1310 .IR F .
1313 .B @FONTDIR@/ps/download
1314 List of downloadable fonts.
1317 .B @FONTDIR@/ps/text.enc
1318 Encoding used for text fonts.
1321 .B @MACRODIR@/ps.tmac
1322 Macros for use with
1323 .BR @L_D_PS@ ;
1324 automatically loaded by
1325 .BR troffrc
1328 .B @MACRODIR@/pspic.tmac
1329 Definition of
1330 .B PSPIC
1331 macro,
1332 automatically loaded by
1333 .BR ps.tmac .
1336 .B @MACRODIR@/psold.tmac
1337 Macros to disable use of characters not present in older
1338 PostScript printers (e.g., `eth' or `thorn').
1341 .SH "SEE ALSO"
1343 .BR \%@L_AFMTODIT@ (@MAN1EXT@),
1344 .BR @L_ROFF@ (@MAN1EXT@),
1345 .BR @L_TROFF@ (@MAN1EXT@),
1346 .BR \%@L_PFBTOPS@ (@MAN1EXT@),
1347 .BR \%@L_ROFF@-out (@MAN5EXT@),
1348 .BR \%@L_ROFF@-font (@MAN5EXT@),
1349 .BR \%@L_ROFF@-char (@MAN7EXT@),
1350 .BR \%@L_ROFF@-tmac (@MAN5EXT@)
1353 .UR http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf
1354 PostScript Language Document Structuring Conventions Specification
1357 .cp \n[__compat]
1358 .rr __compat
1360 .\" s-ts-mode