Adapt src/dev-html (src/devices/grohtml)
[s-roff.git] / src / devices / grops / grops.man
blobb64ec6a6c3118887cc382970cafd54cedf24f9f1
1 .ig
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
18 the original English.
22 .\" Like TP, but if specified indent is more than half
23 .\" the current line-length - indent, use the default indent.
24 .de Tp
25 .  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
26 .  el .TP "\\$1"
29 .de FT
30 .  if '\\*(.T'ps' .ft \\$1
34 .TH GROPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
37 .SH NAME
39 grops \- PostScript driver for groff
42 .SH SYNOPSIS
44 .SY grops
45 .OP \-glmv
46 .OP \-b n
47 .OP \-c n
48 .OP \-F dir
49 .OP \-I dir
50 .OP \-p papersize
51 .OP \-P prologue
52 .OP \-w n
53 .RI [ files
54 .IR .\|.\|. ]
55 .YS
57 .LP
58 It is possible to have whitespace between a command line option and its
59 parameter.
62 .SH DESCRIPTION
64 .B grops
65 translates the output of GNU
66 .B troff
67 to PostScript.
69 Normally
70 .B grops
71 should be invoked by using the groff command
72 with a
73 .B \-Tps
74 option.
76 .if '@DEVICE@'ps' (Actually, this is the default for groff.)
78 If no files are given,
79 .B grops
80 reads the standard input.
82 A filename of
83 .B \-
84 also causes
85 .B grops
86 to read the standard input.
88 PostScript output is written to the standard output.
90 When
91 .B grops
92 is run by
93 .B groff
94 options can be passed to
95 .B grops
96 using
97 .BR groff 's
98 .B \-P
99 option.
102 Note that
103 .B grops
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
113 .BR grops .
116 .SH OPTIONS
119 .BI \-b n
120 Provide workarounds for older printers, broken spoolers, and previewers.
122 Normally
123 .B grops
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.
129 The value of\~\c
130 .I n
131 controls what
132 .B grops
133 does to make its output acceptable to such programs.
135 A value of\~0 causes grops not to employ any workarounds.
138 Add\~1 if no
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
144 anything between the
145 .B %%End\%Prolog
146 comment and the first
147 .B %%Page
148 comment.
151 Add\~2 if lines in included files beginning with
152 .B %!\&
153 should be stripped out; this is needed for Sun's pageview previewer.
156 Add\~4 if
157 .BR %%Page ,
158 .BR %%Trailer
160 .B %%End\%Prolog
161 comments should be
162 stripped out of included files; this is needed for spoolers that
163 don't understand the
164 .B %%Begin\%Document
166 .B %%End\%Document
167 comments.
170 Add\~8 if the first line of the PostScript output should be
171 .B %!PS-Adobe-2.0
172 rather than
173 .BR %!PS-Adobe-3.0 ;
174 this is needed when using Sun's Newsprint with a printer that requires
175 page reversal.
178 Add\~16 if no media size information should be included in the document
179 (this is, neither use
180 .B %%Document\%Media
181 nor the
182 .B setpagedevice
183 PostScript command).
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
196 .BI broken\  n
199 command in the DESC file.
201 Otherwise the default value is\~0.
205 .BI \-c n
206 Print
207 .I n
208 copies of each page.
211 .BI \-F dir
212 Prepend directory
213 .IB dir /dev name
214 to the search path for prologue, font, and device description files;
215 .I name
216 is the name of the device, usually
217 .BR ps .
220 .BI \-g
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.
232 .BI \-I dir
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'
237 .B \[rs]X'ps: file'
238 escapes.
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,
247 .B \-I.\&
248 at the appropriate place.
251 No directory search is performed for files with an absolute file name.
254 .B \-l
255 Print the document in landscape format.
258 .B \-m
259 Turn manual feed on for the document.
262 .BI \-p paper-size
263 Set physical dimension of output medium.
265 This overrides the
266 .BR papersize ,
267 .BR paperlength ,
269 .B paperwidth
270 commands in the
271 .B DESC
272 file; it accepts the same arguments as the
273 .B papersize
274 command.
277 .B groff_font (@MAN5EXT@)
278 for details.
281 .BI \-P prologue-file
282 Use the file
283 .I prologue-file
284 (in the font path) as the prologue instead of the default prologue file
285 .BR prologue .
287 This option overrides the environment variable
288 .SM GROPS_PROLOGUE.
291 .BI \-w n
292 Lines should be drawn using a thickness of
293 .IR n \~\c
294 thousandths of an em.
296 If this option is not given, the line thickness defaults to 0.04\~em.
299 .B \-v
300 Print the version number.
303 .SH USAGE
305 The input to
306 .B grops
307 must be in the format output by
308 .BR @g@troff (@MAN1EXT@).
310 This is described in
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
318 .BR sizescale .
321 .B ps
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
335 .IR psname .
337 It may also contain a command
339 .BI encoding\  enc_file
341 which says that
342 the PostScript font should be reencoded using the encoding described in
343 .IR enc_file ;
344 this file should consist of a sequence of lines of the form:
347 pschar code
349 where
350 .I pschar
351 is the PostScript name of the character,
353 .I code
354 is its position in the encoding expressed as a decimal integer; valid
355 values are in the range 0 to\~255.
357 Lines starting with
358 .B #
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
366 .B \[rs]N
367 escape sequence in
368 .B troff
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.
376 .B grops
377 assumes that a character with a groff name of
378 .B space
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.
384 Note that
385 .B grops
386 is able to display all glyphs in a PostScript font, not only 256.
387 .I enc_file
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
391 .B grops
392 produces on the fly.
395 .B grops
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
406 .B grops
407 must be listed in the file
408 .BR @FONTDIR@/devps/download ;
409 this should consist of lines of the form
413 font filename
416 where
417 .I font
418 is the PostScript name of the font,
420 .I filename
421 is the name of the file containing the font;
422 lines beginning with
423 .B #
424 and blank lines are ignored;
425 fields may be separated by tabs or spaces;
426 .I filename
427 is searched for using the same mechanism that is used
428 for groff font metric files.
431 .B download
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,
438 then
439 .B grops
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
444 .B download
445 file
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.
458 .B grops
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
473 %%EndComments
476 %%IncludeResource: font Garamond
479 In this case both Garamond and Garamond-Outline would need to be listed
480 in the
481 .B download
482 file.
484 A downloadable font should not include its own name in a
485 .B %%Document\%Supplied\%Resources
486 comment.
489 .B grops
490 does not interpret
491 .B %%Document\%Fonts
492 comments.
495 .BR %%Document\%Needed\%Resources ,
496 .BR %%Document\%Supplied\%Resources ,
497 .BR %%Include\%Resource ,
498 .BR %%Begin\%Resource ,
500 .BR %%End\%Resource
501 comments
502 (or possibly the old
503 .BR %%Document\%Needed\%Fonts ,
504 .BR %%Document\%Supplied\%Fonts ,
505 .BR %%Include\%Font ,
506 .BR %%Begin\%Font ,
508 .BR %%End\%Font
509 comments)
510 should be used.
513 In the default setup
514 there are styles called
515 .BR R ,
516 .BR I ,
517 .BR B ,
519 .B BI
520 mounted at font positions 1 to\~4.
522 The fonts are grouped into families
523 .BR A ,
524 .BR BM ,
525 .BR C ,
526 .BR H ,
527 .BR HN ,
528 .BR N ,
529 .BR P ,
530 and\~\c
531 .B T
532 having members in each of these styles:
536 .B AR
537 .FT AR
538 AvantGarde-Book
542 .B AI
543 .FT AI
544 AvantGarde-BookOblique
548 .B AB
549 .FT AB
550 AvantGarde-Demi
554 .B ABI
555 .FT ABI
556 AvantGarde-DemiOblique
560 .B BMR
561 .FT BMR
562 Bookman-Light
566 .B BMI
567 .FT BMI
568 Bookman-LightItalic
572 .B BMB
573 .FT BMB
574 Bookman-Demi
578 .B BMBI
579 .FT BMBI
580 Bookman-DemiItalic
584 .B CR
585 .FT CR
586 Courier
590 .B CI
591 .FT CI
592 Courier-Oblique
596 .B CB
597 .FT CB
598 Courier-Bold
602 .B CBI
603 .FT CBI
604 Courier-BoldOblique
608 .B HR
609 .FT HR
610 Helvetica
614 .B HI
615 .FT HI
616 Helvetica-Oblique
620 .B HB
621 .FT HB
622 Helvetica-Bold
626 .B HBI
627 .FT HBI
628 Helvetica-BoldOblique
632 .B HNR
633 .FT HNR
634 Helvetica-Narrow
638 .B HNI
639 .FT HNI
640 Helvetica-Narrow-Oblique
644 .B HNB
645 .FT HNB
646 Helvetica-Narrow-Bold
650 .B HNBI
651 .FT HNBI
652 Helvetica-Narrow-BoldOblique
656 .B NR
657 .FT NR
658 NewCenturySchlbk-Roman
662 .B NI
663 .FT NI
664 NewCenturySchlbk-Italic
668 .B NB
669 .FT NB
670 NewCenturySchlbk-Bold
674 .B NBI
675 .FT NBI
676 NewCenturySchlbk-BoldItalic
680 .B PR
681 .FT PR
682 Palatino-Roman
686 .B PI
687 .FT PI
688 Palatino-Italic
692 .B PB
693 .FT PB
694 Palatino-Bold
698 .B PBI
699 .FT PBI
700 Palatino-BoldItalic
704 .B TR
705 .FT TR
706 Times-Roman
710 .B TI
711 .FT TI
712 Times-Italic
716 .B TB
717 .FT TB
718 Times-Bold
722 .B TBI
723 .FT TBI
724 Times-BoldItalic
729 There is also the following font which is not a member of a family:
733 .B ZCMI
734 .FT ZCMI
735 ZapfChancery-MediumItalic
740 There are also some special fonts called
741 .B S
742 for the PS Symbol font, and
743 .BR SS ,
744 containing slanted lowercase Greek letters taken from PS Symbol.
746 Zapf Dingbats is available as
747 .BR ZD ,
748 and a reversed version of ZapfDingbats (with symbols pointing in the opposite
749 direction) is available as
750 .BR ZDR ;
751 most characters in these fonts are unnamed and must be accessed using
752 .BR \[rs]N .
755 The default color for
756 .B \[rs]m
758 .B \[rs]M
759 is black; for colors defined in the `rgb' color space
760 .B setrgbcolor
761 is used, for `cmy' and `cmyk'
762 .BR setcmykcolor ,
763 and for `gray'
764 .BR setgray .
766 Note that
767 .B setcmykcolor
768 is a PostScript LanguageLevel\~2 command and thus not available on some
769 older printers.
772 .B grops
773 understands various X\~commands produced using the
774 .B \[rs]X
775 escape sequence;
776 .B grops
777 only interprets commands that begin with a
778 .B ps:
779 tag.
782 .BI \[rs]X'ps:\ exec\  code '
783 This executes the arbitrary PostScript commands in
784 .IR code .
786 The PostScript currentpoint is set to the position of the
787 .B \[rs]X
788 command before executing
789 .IR code .
791 The origin is at the top left corner of the page,
792 and y\~coordinates increase down the page.
794 A procedure\~\c
795 .B u
796 is defined that converts groff units
797 to the coordinate system in effect (provided the user doesn't change the
798 scale).
800 For example,
805 \&.nr x 1i
808 \[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
813 draws a horizontal line one inch long.
815 .I code
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
820 .B def
822 .B mdef
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.
831 If you use the
832 .B \[rs]Y
833 escape sequence with an argument that names a macro,
834 .I code
835 can extend over multiple lines.
837 For example,
842 .ft B
843 \&.nr x 1i
844 \&.de y
845 \&ps: exec
846 \&\[rs]nx u 0 rlineto
847 \&stroke
848 \&..
849 \&\[rs]Yy
850 .ft R
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
859 units with the
860 .B u
861 procedure.
864 .B grops
865 wraps user-specified PostScript code into a dictionary, nothing more.
867 In particular, it doesn't start and end the inserted code with
868 .B save
870 .BR restore ,
871 respectively.
873 This must be supplied by the user, if necessary.
878 .BI \[rs]X'ps:\ file\  name '
879 This is the same as the
880 .B exec
881 command except that the PostScript code is read from file
882 .IR name .
885 .BI \[rs]X'ps:\ def\  code '
886 Place a PostScript definition contained in
887 .I code
888 in the prologue.
890 There should be at most one definition per
891 .B \[rs]X
892 command.
894 Long definitions can be split over several
895 .B \[rs]X
896 commands;
897 all the
898 .I code
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
903 .B exec
904 command is executed.
906 If you use the
907 .B \[rs]Y
908 escape sequence with an argument that names a macro,
909 .I code
910 can extend over multiple lines.
913 .BI \[rs]X'ps:\ mdef\  n\ code  '
914 Like
915 .BR def ,
916 except that
917 .I code
918 may contain up to
919 .IR n \~\c
920 definitions.
922 .B grops
923 needs to know how many definitions
924 .I code
925 contains
926 so that it can create an appropriately sized PostScript dictionary
927 to contain them.
930 .BI \[rs]X'ps:\ import\  file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
931 Import a PostScript graphic from
932 .IR file .
934 The arguments
935 .IR llx ,
936 .IR lly ,
937 .IR urx ,
939 .I ury
940 give the bounding box of the graphic in the default PostScript
941 coordinate system; they should all be integers;
942 .I llx
944 .I lly
945 are the x and y\~coordinates of the lower left
946 corner of the graphic;
947 .I urx
949 .I ury
950 are the x and y\~coordinates of the upper right corner of the graphic;
951 .I width
953 .I height
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
961 .B \[rs]X
962 command.
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
969 .B \[rs]X
970 command are not interpreted by
971 .BR troff ;
972 so vertical space for the graphic is not automatically added,
973 and the
974 .I width
976 .I height
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
982 .B %%Bounding\%Box
983 comment, then the bounding box can be automatically
984 extracted from within groff by using the
985 .B psbb
986 request.
990 .BR groff_tmac (@MAN5EXT@)
991 for a description of the
992 .B PSPIC
993 macro which provides a convenient high-level interface for inclusion of
994 PostScript graphics.
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
1002 .B \[rs]X
1003 commands.
1005 These commands are intended for use when output from
1006 .B troff
1007 is previewed before being processed with
1008 .BR grops ;
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
1012 .B \[rs]X
1013 commands.
1017 For example,
1018 .B \%gxditview
1019 is not able to display a proper
1020 .B \[rs](em
1021 character because the standard X11 fonts do not provide it;
1022 this problem can be overcome by executing the following
1023 request
1026 .ft B
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
1035 In this case,
1036 .B \%gxditview
1037 is unable to display the
1038 .B \[rs](em
1039 character and draws the line,
1040 whereas
1041 .B grops
1042 prints the
1043 .B \[rs](em
1044 character
1045 and ignores the line (this code is already in file
1046 .B Xps.tmac
1047 which is loaded if a document intended for
1048 .B grops
1049 is previewed with
1050 .BR \%gxditview ).
1054 If a PostScript procedure
1055 .B BPhook
1056 has been defined via a
1057 .RB ` ps:\ def '
1059 .RB ` ps:\ mdef '
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
1067 .ft B
1068 \&.de XX
1069 ps: def
1070 /BPhook
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
1075   grestore }
1077 \&..
1078 \&.devicem XX
1079 .ft R
1083 Or, to cause lines and polygons to be drawn with square linecaps
1084 and mitered linejoins instead of the round linecaps and linejoins
1085 normally used by
1086 .BR grops ,
1091 .ft B
1092 \&.de XX
1093 ps: def
1094 /BPhook { 2 setlinecap 0 setlinejoin } def
1095 \&..
1096 \&.devicem XX
1097 .ft R
1101 (square linecaps, as opposed to butt linecaps (0 setlinecap),
1102 give true corners in boxed tables even though the lines are
1103 drawn unconnected).
1106 .SS Encapsulated PostScript
1107 .B grops
1108 itself doesn't emit bounding box information.
1110 With the help of Ghostscript the following simple script,
1111 .BR groff2eps ,
1112 produces an encapsulated PS file.
1117 .ft B
1118 #! /bin/sh
1119 groff \-P\-b16 $1 >$1.ps
1120 gs \-dNOPAUSE \-sDEVICE=bbox \-\- $1.ps 2>$1.bbox
1121 cat $1.ps \[rs]
1122 | sed \-e "/\[ha]%%Orientation/r$1.bbox" \[rs]
1123       \-e "/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/" >$1.eps
1124 rm $1.ps $1.bbox
1125 .ft R
1130 Just say
1134 groff2eps foo
1137 to convert file
1138 .B foo
1140 .BR foo.eps .
1143 .SS TrueType and other font formats
1144 TrueType fonts can be used with
1145 .B grops
1146 if converted first to
1147 .B "Type\~42"
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
1155 .BR gs (1).
1158 Yet, the easiest method involves the use of the application
1159 .BR ttftot42 (1).
1161 This program uses
1162 .BR freetype (3)
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
1170 .B download
1171 file.
1172 .B ttftot42
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/
1176 .UE .
1179 Another solution for creating type42 wrappers is to use FontForge,
1180 available from
1181 .UR http://\:fontforge.sf.net
1182 http://\:fontforge.sf.net
1183 .UE .
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
1191 .BR grops .
1193 .ds BU \[bu]\ \ \"
1194 .de LI
1195 .IP "" 4
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
1237 .B ttftot42
1239 .BR fontforge .
1240 For all other font formats use
1241 .B fontforge
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@)
1247 program.
1249 An example call is
1253 afmtodit Foo-Bar-Bold.afm textmap FBB
1257 which converts the metric file `Foo-Bar-Bold.afm' to the groff
1258 font `FBB'.
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
1262 .BR R ,
1263 .BR B ,
1264 .BR I ,
1266 .BR BI ,
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
1272 .BR T ,
1273 and the groff font names are
1274 .BR TR ,
1275 .BR TB ,
1276 .BR TI ,
1278 .BR TBI .
1281 Install both the groff font description files and the fonts in a
1282 `devps' subdirectory of the font path which groff finds.
1284 See the
1285 .B ENVIRONMENT
1286 section in the
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
1291 store them anyway).
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
1304 .B internalname
1305 field in the `FBB' file), thus the following line should be added to
1306 `download'.
1310 .B XY-Foo-Bar-Bold Foo-Bar-Bold.pfa
1315 .SH OLD FONTS
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
1327 directory.
1330 To use them, make sure that
1331 .B grops
1332 finds the fonts before the default system fonts (with the same names):
1333 Either add command line option
1334 .B \-F
1336 .B grops
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@
1348 .SH ENVIRONMENT
1352 .B GROPS_PROLOGUE
1353 If this is set to
1354 .IR foo ,
1355 then
1356 .B grops
1357 uses the file
1358 .I foo
1359 (in the font path) instead of the default prologue file
1360 .BR prologue .
1362 The option
1363 .B \-P
1364 overrides this environment variable.
1369 .B GROFF_FONT_PATH
1370 A list of directories in which to search for the
1371 .BI dev name
1372 directory in addition to the default ones.
1375 .BR @g@troff (@MAN1EXT@)
1377 .BR \%groff_font (@MAN5EXT@)
1378 for more details.
1381 .SH FILES
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
1390 .IR F .
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
1402 Macros for use with
1403 .BR grops ;
1404 automatically loaded by
1405 .BR troffrc
1408 .B @MACRODIR@/pspic.tmac
1409 Definition of
1410 .B PSPIC
1411 macro,
1412 automatically loaded by
1413 .BR ps.tmac .
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
1422 Temporary file.
1425 .SH "SEE ALSO"
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:
1443 .\" mode: nroff
1444 .\" End: