Remove no longer needed catman periodic via 'make upgrade'.
[dragonfly.git] / contrib / groff / src / devices / grops / grops.man
1 .ig
2 Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008,
3               2009
4   Free Software Foundation, Inc.
5
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.
9
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.
14
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
19 the original English.
20 ..
21 .
22 .
23 .\" Like TP, but if specified indent is more than half
24 .\" the current line-length - indent, use the default indent.
25 .de Tp
26 .  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
27 .  el .TP "\\$1"
28 ..
29 .
30 .de FT
31 .  if '\\*(.T'ps' .ft \\$1
32 ..
33 .
34 .
35 .TH GROPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
36 .
37 .
38 .SH NAME
39 .
40 grops \- PostScript driver for groff
41 .
42 .
43 .SH SYNOPSIS
44 .
45 .SY grops
46 .OP \-glmv
47 .OP \-b n
48 .OP \-c n
49 .OP \-F dir
50 .OP \-I dir
51 .OP \-p papersize
52 .OP \-P prologue
53 .OP \-w n
54 .RI [ files
55 .IR .\|.\|. ]
56 .YS
57 .
58 .LP
59 It is possible to have whitespace between a command line option and its
60 parameter.
61 .
62 .
63 .SH DESCRIPTION
64 .
65 .B grops
66 translates the output of GNU
67 .B troff
68 to PostScript.
69 .
70 Normally
71 .B grops
72 should be invoked by using the groff command
73 with a
74 .B \-Tps
75 option.
76 .
77 .if '@DEVICE@'ps' (Actually, this is the default for groff.)
78 .
79 If no files are given,
80 .B grops
81 reads the standard input.
82 .
83 A filename of
84 .B \-
85 also causes
86 .B grops
87 to read the standard input.
88 .
89 PostScript output is written to the standard output.
90 .
91 When
92 .B grops
93 is run by
94 .B groff
95 options can be passed to
96 .B grops
97 using
98 .BR groff 's
99 .B \-P
100 option.
101 .
102 .LP
103 Note that
104 .B grops
105 doesn't produce a valid document structure (conforming to the Document
106 Structuring Convention) if called with multiple file arguments.
107 .
108 To print such concatenated output it is necessary to deactivate DSC
109 handling in the printing program or previewer.
110 .
111 See section
112 .B FONT INSTALLATION
113 below for a guide how to install fonts for
114 .BR grops .
115 .
116 .
117 .SH OPTIONS
118 .
119 .TP
120 .BI \-b n
121 Provide workarounds for older printers, broken spoolers, and previewers.
122 .
123 Normally
124 .B grops
125 produces output at PostScript LanguageLevel\~2 that conforms to the
126 Document Structuring Conventions version 3.0.
127 .
128 Some older printers, spoolers, and previewers can't handle such output.
129 .
130 The value of\~\c
131 .I n
132 controls what
133 .B grops
134 does to make its output acceptable to such programs.
135 .
136 A value of\~0 causes grops not to employ any workarounds.
137 .
138 .IP
139 Add\~1 if no
140 .B %%Begin\%Document\%Setup
141 and
142 .B %%End\%Document\%Setup
143 comments should be generated;
144 this is needed for early versions of TranScript that get confused by
145 anything between the
146 .B %%End\%Prolog
147 comment and the first
148 .B %%Page
149 comment.
150 .
151 .IP
152 Add\~2 if lines in included files beginning with
153 .B %!\&
154 should be stripped out; this is needed for Sun's pageview previewer.
155 .
156 .IP
157 Add\~4 if
158 .BR %%Page ,
159 .BR %%Trailer
160 and
161 .B %%End\%Prolog
162 comments should be
163 stripped out of included files; this is needed for spoolers that
164 don't understand the
165 .B %%Begin\%Document
166 and
167 .B %%End\%Document
168 comments.
169 .
170 .IP
171 Add\~8 if the first line of the PostScript output should be
172 .B %!PS-Adobe-2.0
173 rather than
174 .BR %!PS-Adobe-3.0 ;
175 this is needed when using Sun's Newsprint with a printer that requires
176 page reversal.
177 .
178 .IP
179 Add\~16 if no media size information should be included in the document
180 (this is, neither use
181 .B %%Document\%Media
182 nor the
183 .B setpagedevice
184 PostScript command).
185 .
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.
188 .
189 It is also necessary if the output is further processed to get an
190 encapsulated PS (EPS) file \[en] see below.
191 .
192 .IP
193 The default value can be specified by a
194 .
195 .RS
196 .IP
197 .BI broken\  n
198 .
199 .LP
200 command in the DESC file.
201 .
202 Otherwise the default value is\~0.
203 .RE
204 .
205 .TP
206 .BI \-c n
207 Print
208 .I n
209 copies of each page.
210 .
211 .TP
212 .BI \-F dir
213 Prepend directory
214 .IB dir /dev name
215 to the search path for prologue, font, and device description files;
216 .I name
217 is the name of the device, usually
218 .BR ps .
219 .
220 .TP
221 .BI \-g
222 Guess the page length.
223 .
224 This generates PostScript code that guesses the page length.
225 .
226 The guess is correct only if the imageable area is vertically
227 centered on the page.
228 .
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.
231 .
232 .TP
233 .BI \-I dir
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'
237 and
238 .B \[rs]X'ps: file'
239 escapes.
240 .
241 The search path is initialized with the current directory.
242 .
243 This option may be specified more than once; the directories are then
244 searched in the order specified (but before the current directory).
245 .
246 If you want to make the current directory be read before other directories,
247 add
248 .B \-I.\&
249 at the appropriate place.
250 .
251 .IP
252 No directory search is performed for files with an absolute file name.
253 .
254 .TP
255 .B \-l
256 Print the document in landscape format.
257 .
258 .TP
259 .B \-m
260 Turn manual feed on for the document.
261 .
262 .TP
263 .BI \-p paper-size
264 Set physical dimension of output medium.
265 .
266 This overrides the
267 .BR papersize ,
268 .BR paperlength ,
269 and
270 .B paperwidth
271 commands in the
272 .B DESC
273 file; it accepts the same arguments as the
274 .B papersize
275 command.
276 .
277 See
278 .B groff_font (@MAN5EXT@)
279 for details.
280 .
281 .TP
282 .BI \-P prologue-file
283 Use the file
284 .I prologue-file
285 (in the font path) as the prologue instead of the default prologue file
286 .BR prologue .
287 .
288 This option overrides the environment variable
289 .SM GROPS_PROLOGUE.
290 .
291 .TP
292 .BI \-w n
293 Lines should be drawn using a thickness of
294 .IR n \~\c
295 thousandths of an em.
296 .
297 If this option is not given, the line thickness defaults to 0.04\~em.
298 .
299 .TP
300 .B \-v
301 Print the version number.
302 .
303 .
304 .SH USAGE
305 .
306 The input to
307 .B grops
308 must be in the format output by
309 .BR @g@troff (@MAN1EXT@).
310 .
311 This is described in
312 .BR groff_out (@MAN5EXT@).
313 .
314 .LP
315 In addition, the device and font description files for the device used
316 must meet certain requirements:
317 .
318 The resolution must be an integer multiple of\~72 times the
319 .BR sizescale .
320 .
321 The
322 .B ps
323 device uses a resolution of 72000 and a sizescale of 1000.
324 .
325 .LP
326 The device description file must contain a valid paper size; see
327 .BR groff_font (@MAN5EXT@)
328 for more information.
329 .
330 .LP
331 Each font description file must contain a command
332 .IP
333 .BI internalname\  psname
334 .LP
335 which says that the PostScript name of the font is
336 .IR psname .
337 .
338 It may also contain a command
339 .IP
340 .BI encoding\  enc_file
341 .LP
342 which says that
343 the PostScript font should be reencoded using the encoding described in
344 .IR enc_file ;
345 this file should consist of a sequence of lines of the form:
346 .IP
347 .I
348 pschar code
349 .LP
350 where
351 .I pschar
352 is the PostScript name of the character,
353 and
354 .I code
355 is its position in the encoding expressed as a decimal integer; valid
356 values are in the range 0 to\~255.
357 .
358 Lines starting with
359 .B #
360 and blank lines are ignored.
361 .
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.
365 .
366 This code can be used with the
367 .B \[rs]N
368 escape sequence in
369 .B troff
370 to select the character,
371 even if the character does not have a groff name.
372 .
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.
376 .
377 .B grops
378 assumes that a character with a groff name of
379 .B space
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.
383 .
384 .LP
385 Note that
386 .B grops
387 is able to display all glyphs in a PostScript font, not only 256.
388 .I enc_file
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
392 .B grops
393 produces on the fly.
394 .
395 .LP
396 .B grops
397 can automatically include the downloadable fonts necessary
398 to print the document.
399 .
400 Such fonts must be in PFA format.
401 .
402 Use
403 .BR \%pfbtops (@MAN1EXT@)
404 to convert a Type\~1 font in PFB format.
405 .
406 Any downloadable fonts which should, when required, be included by
407 .B grops
408 must be listed in the file
409 .BR @FONTDIR@/devps/download ;
410 this should consist of lines of the form
411 .
412 .IP
413 .I
414 font filename
415 .
416 .LP
417 where
418 .I font
419 is the PostScript name of the font,
420 and
421 .I filename
422 is the name of the file containing the font;
423 lines beginning with
424 .B #
425 and blank lines are ignored;
426 fields may be separated by tabs or spaces;
427 .I filename
428 is searched for using the same mechanism that is used
429 for groff font metric files.
430 .
431 The
432 .B download
433 file itself is also searched for using this mechanism;
434 currently, only the first found file in the font path is used.
435 .
436 .LP
437 If the file containing a downloadable font or imported document
438 conforms to the Adobe Document Structuring Conventions,
439 then
440 .B grops
441 interprets any comments in the files sufficiently to ensure that its
442 own output is conforming.
443 .
444 It also supplies any needed font resources that are listed in the
445 .B download
446 file
447 as well as any needed file resources.
448 .
449 It is also able to handle inter-resource dependencies.
450 .
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.
458 .
459 .B grops
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
465 .
466 .IP
467 .B
468 %!PS-Adobe-3.0 Resource-Font
469 .br
470 .B
471 %%DocumentNeededResources: font Garamond
472 .br
473 .B
474 %%EndComments
475 .br
476 .B
477 %%IncludeResource: font Garamond
478 .
479 .LP
480 In this case both Garamond and Garamond-Outline would need to be listed
481 in the
482 .B download
483 file.
484 .
485 A downloadable font should not include its own name in a
486 .B %%Document\%Supplied\%Resources
487 comment.
488 .
489 .LP
490 .B grops
491 does not interpret
492 .B %%Document\%Fonts
493 comments.
494 .
495 The
496 .BR %%Document\%Needed\%Resources ,
497 .BR %%Document\%Supplied\%Resources ,
498 .BR %%Include\%Resource ,
499 .BR %%Begin\%Resource ,
500 and
501 .BR %%End\%Resource
502 comments
503 (or possibly the old
504 .BR %%Document\%Needed\%Fonts ,
505 .BR %%Document\%Supplied\%Fonts ,
506 .BR %%Include\%Font ,
507 .BR %%Begin\%Font ,
508 and
509 .BR %%End\%Font
510 comments)
511 should be used.
512 .
513 .LP
514 In the default setup
515 there are styles called
516 .BR R ,
517 .BR I ,
518 .BR B ,
519 and
520 .B BI
521 mounted at font positions 1 to\~4.
522 .
523 The fonts are grouped into families
524 .BR A ,
525 .BR BM ,
526 .BR C ,
527 .BR H ,
528 .BR HN ,
529 .BR N ,
530 .BR P ,
531 and\~\c
532 .B T
533 having members in each of these styles:
534 .
535 .RS
536 .TP
537 .B AR
538 .FT AR
539 AvantGarde-Book
540 .FT
541 .
542 .TQ
543 .B AI
544 .FT AI
545 AvantGarde-BookOblique
546 .FT
547 .
548 .TQ
549 .B AB
550 .FT AB
551 AvantGarde-Demi
552 .FT
553 .
554 .TQ
555 .B ABI
556 .FT ABI
557 AvantGarde-DemiOblique
558 .FT
559 .
560 .TQ
561 .B BMR
562 .FT BMR
563 Bookman-Light
564 .FT
565 .
566 .TQ
567 .B BMI
568 .FT BMI
569 Bookman-LightItalic
570 .FT
571 .
572 .TQ
573 .B BMB
574 .FT BMB
575 Bookman-Demi
576 .FT
577 .
578 .TQ
579 .B BMBI
580 .FT BMBI
581 Bookman-DemiItalic
582 .FT
583 .
584 .TQ
585 .B CR
586 .FT CR
587 Courier
588 .FT
589 .
590 .TQ
591 .B CI
592 .FT CI
593 Courier-Oblique
594 .FT
595 .
596 .TQ
597 .B CB
598 .FT CB
599 Courier-Bold
600 .FT
601 .
602 .TQ
603 .B CBI
604 .FT CBI
605 Courier-BoldOblique
606 .FT
607 .
608 .TQ
609 .B HR
610 .FT HR
611 Helvetica
612 .FT
613 .
614 .TQ
615 .B HI
616 .FT HI
617 Helvetica-Oblique
618 .FT
619 .
620 .TQ
621 .B HB
622 .FT HB
623 Helvetica-Bold
624 .FT
625 .
626 .TQ
627 .B HBI
628 .FT HBI
629 Helvetica-BoldOblique
630 .FT
631 .
632 .TQ
633 .B HNR
634 .FT HNR
635 Helvetica-Narrow
636 .FT
637 .
638 .TQ
639 .B HNI
640 .FT HNI
641 Helvetica-Narrow-Oblique
642 .FT
643 .
644 .TQ
645 .B HNB
646 .FT HNB
647 Helvetica-Narrow-Bold
648 .FT
649 .
650 .TQ
651 .B HNBI
652 .FT HNBI
653 Helvetica-Narrow-BoldOblique
654 .FT
655 .
656 .TQ
657 .B NR
658 .FT NR
659 NewCenturySchlbk-Roman
660 .FT
661 .
662 .TQ
663 .B NI
664 .FT NI
665 NewCenturySchlbk-Italic
666 .FT
667 .
668 .TQ
669 .B NB
670 .FT NB
671 NewCenturySchlbk-Bold
672 .FT
673 .
674 .TQ
675 .B NBI
676 .FT NBI
677 NewCenturySchlbk-BoldItalic
678 .FT
679 .
680 .TQ
681 .B PR
682 .FT PR
683 Palatino-Roman
684 .FT
685 .
686 .TQ
687 .B PI
688 .FT PI
689 Palatino-Italic
690 .FT
691 .
692 .TQ
693 .B PB
694 .FT PB
695 Palatino-Bold
696 .FT
697 .
698 .TQ
699 .B PBI
700 .FT PBI
701 Palatino-BoldItalic
702 .FT
703 .
704 .TQ
705 .B TR
706 .FT TR
707 Times-Roman
708 .FT
709 .
710 .TQ
711 .B TI
712 .FT TI
713 Times-Italic
714 .FT
715 .
716 .TQ
717 .B TB
718 .FT TB
719 Times-Bold
720 .FT
721 .
722 .TQ
723 .B TBI
724 .FT TBI
725 Times-BoldItalic
726 .FT
727 .RE
728 .
729 .LP
730 There is also the following font which is not a member of a family:
731 .
732 .RS
733 .TP
734 .B ZCMI
735 .FT ZCMI
736 ZapfChancery-MediumItalic
737 .FT
738 .RE
739 .
740 .LP
741 There are also some special fonts called
742 .B S
743 for the PS Symbol font, and
744 .BR SS ,
745 containing slanted lowercase Greek letters taken from PS Symbol.
746 .
747 Zapf Dingbats is available as
748 .BR ZD ,
749 and a reversed version of ZapfDingbats (with symbols pointing in the opposite
750 direction) is available as
751 .BR ZDR ;
752 most characters in these fonts are unnamed and must be accessed using
753 .BR \[rs]N .
754 .
755 .LP
756 The default color for
757 .B \[rs]m
758 and
759 .B \[rs]M
760 is black; for colors defined in the `rgb' color space
761 .B setrgbcolor
762 is used, for `cmy' and `cmyk'
763 .BR setcmykcolor ,
764 and for `gray'
765 .BR setgray .
766 .
767 Note that
768 .B setcmykcolor
769 is a PostScript LanguageLevel\~2 command and thus not available on some
770 older printers.
771 .
772 .LP
773 .B grops
774 understands various X\~commands produced using the
775 .B \[rs]X
776 escape sequence;
777 .B grops
778 only interprets commands that begin with a
779 .B ps:
780 tag.
781 .
782 .TP
783 .BI \[rs]X'ps:\ exec\  code '
784 This executes the arbitrary PostScript commands in
785 .IR code .
786 .
787 The PostScript currentpoint is set to the position of the
788 .B \[rs]X
789 command before executing
790 .IR code .
791 .
792 The origin is at the top left corner of the page,
793 and y\~coordinates increase down the page.
794 .
795 A procedure\~\c
796 .B u
797 is defined that converts groff units
798 to the coordinate system in effect (provided the user doesn't change the
799 scale).
800 .
801 For example,
802 .
803 .RS
804 .IP
805 .B
806 \&.nr x 1i
807 .br
808 .B
809 \[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
810 .br
811 .RE
812 .
813 .IP
814 draws a horizontal line one inch long.
815 .
816 .I code
817 may make changes to the graphics state,
818 but any changes persist only to the end of the page.
819 .
820 A dictionary containing the definitions specified by the
821 .B def
822 and
823 .B mdef
824 is on top of the dictionary stack.
825 .
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.
829 .
830 Any definitions persist only until the end of the page.
831 .
832 If you use the
833 .B \[rs]Y
834 escape sequence with an argument that names a macro,
835 .I code
836 can extend over multiple lines.
837 .
838 For example,
839 .
840 .RS
841 .IP
842 .nf
843 .ft B
844 \&.nr x 1i
845 \&.de y
846 \&ps: exec
847 \&\[rs]nx u 0 rlineto
848 \&stroke
849 \&..
850 \&\[rs]Yy
851 .ft R
852 .fi
853 .
854 .LP
855 is another way to draw a horizontal line one inch long.
856 .
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
860 units with the
861 .B u
862 procedure.
863 .
864 .LP
865 .B grops
866 wraps user-specified PostScript code into a dictionary, nothing more.
867 .
868 In particular, it doesn't start and end the inserted code with
869 .B save
870 and
871 .BR restore ,
872 respectively.
873 .
874 This must be supplied by the user, if necessary.
875 .
876 .RE
877 .
878 .TP
879 .BI \[rs]X'ps:\ file\  name '
880 This is the same as the
881 .B exec
882 command except that the PostScript code is read from file
883 .IR name .
884 .
885 .TP
886 .BI \[rs]X'ps:\ def\  code '
887 Place a PostScript definition contained in
888 .I code
889 in the prologue.
890 .
891 There should be at most one definition per
892 .B \[rs]X
893 command.
894 .
895 Long definitions can be split over several
896 .B \[rs]X
897 commands;
898 all the
899 .I code
900 arguments are simply joined together separated by newlines.
901 .
902 The definitions are placed in a dictionary which is automatically
903 pushed on the dictionary stack when an
904 .B exec
905 command is executed.
906 .
907 If you use the
908 .B \[rs]Y
909 escape sequence with an argument that names a macro,
910 .I code
911 can extend over multiple lines.
912 .
913 .TP
914 .BI \[rs]X'ps:\ mdef\  n\ code  '
915 Like
916 .BR def ,
917 except that
918 .I code
919 may contain up to
920 .IR n \~\c
921 definitions.
922 .
923 .B grops
924 needs to know how many definitions
925 .I code
926 contains
927 so that it can create an appropriately sized PostScript dictionary
928 to contain them.
929 .
930 .TP
931 .BI \[rs]X'ps:\ import\  file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
932 Import a PostScript graphic from
933 .IR file .
934 .
935 The arguments
936 .IR llx ,
937 .IR lly ,
938 .IR urx ,
939 and
940 .I ury
941 give the bounding box of the graphic in the default PostScript
942 coordinate system; they should all be integers;
943 .I llx
944 and
945 .I lly
946 are the x and y\~coordinates of the lower left
947 corner of the graphic;
948 .I urx
949 and
950 .I ury
951 are the x and y\~coordinates of the upper right corner of the graphic;
952 .I width
953 and
954 .I height
955 are integers that give the desired width and height in groff
956 units of the graphic.
957 .
958 .IP
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
962 .B \[rs]X
963 command.
964 .
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.
967 .
968 .IP
969 Note that the contents of the
970 .B \[rs]X
971 command are not interpreted by
972 .BR troff ;
973 so vertical space for the graphic is not automatically added,
974 and the
975 .I width
976 and
977 .I height
978 arguments are not allowed to have attached scaling indicators.
979 .
980 .IP
981 If the PostScript file complies with the Adobe Document Structuring
982 Conventions and contains a
983 .B %%Bounding\%Box
984 comment, then the bounding box can be automatically
985 extracted from within groff by using the
986 .B psbb
987 request.
988 .
989 .IP
990 See
991 .BR groff_tmac (@MAN5EXT@)
992 for a description of the
993 .B PSPIC
994 macro which provides a convenient high-level interface for inclusion of
995 PostScript graphics.
996 .
997 .TP
998 .B \[rs]X'ps:\ invis'
999 .TQ
1000 .B \[rs]X'ps:\ endinvis'
1001 No output is generated for text and drawing commands
1002 that are bracketed with these
1003 .B \[rs]X
1004 commands.
1005 .
1006 These commands are intended for use when output from
1007 .B troff
1008 is previewed before being processed with
1009 .BR grops ;
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
1013 .B \[rs]X
1014 commands.
1015 .
1016 .RS
1017 .LP
1018 For example,
1019 .B \%gxditview
1020 is not able to display a proper
1021 .B \[rs](em
1022 character because the standard X11 fonts do not provide it;
1023 this problem can be overcome by executing the following
1024 request
1025 .
1026 .IP
1027 .ft B
1028 .nf
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
1032 .ft
1033 .fi
1034 .
1035 .LP
1036 In this case,
1037 .B \%gxditview
1038 is unable to display the
1039 .B \[rs](em
1040 character and draws the line,
1041 whereas
1042 .B grops
1043 prints the
1044 .B \[rs](em
1045 character
1046 and ignores the line (this code is already in file
1047 .B Xps.tmac
1048 which is loaded if a document intended for
1049 .B grops
1050 is previewed with
1051 .BR \%gxditview ).
1052 .RE
1053 .
1054 .LP
1055 If a PostScript procedure
1056 .B BPhook
1057 has been defined via a
1058 .RB ` ps:\ def '
1059 or
1060 .RB ` ps:\ mdef '
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
1065 .RS
1066 .LP
1067 .nf
1068 .ft B
1069 \&.de XX
1070 ps: def
1071 /BPhook
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
1076   grestore }
1077 def
1078 \&..
1079 \&.devicem XX
1080 .ft R
1081 .fi
1082 .RE
1083 .LP
1084 Or, to cause lines and polygons to be drawn with square linecaps
1085 and mitered linejoins instead of the round linecaps and linejoins
1086 normally used by
1087 .BR grops ,
1088 use
1089 .RS
1090 .LP
1091 .nf
1092 .ft B
1093 \&.de XX
1094 ps: def
1095 /BPhook { 2 setlinecap 0 setlinejoin } def
1096 \&..
1097 \&.devicem XX
1098 .ft R
1099 .fi
1100 .RE
1101 .LP
1102 (square linecaps, as opposed to butt linecaps (0 setlinecap),
1103 give true corners in boxed tables even though the lines are
1104 drawn unconnected).
1105 .
1106 .
1107 .SS Encapsulated PostScript
1108 .B grops
1109 itself doesn't emit bounding box information.
1110 .
1111 With the help of Ghostscript the following simple script,
1112 .BR groff2eps ,
1113 produces an encapsulated PS file.
1114 .
1115 .RS
1116 .LP
1117 .nf
1118 .ft B
1119 #! /bin/sh
1120 groff \-P\-b16 $1 >$1.ps
1121 gs \-dNOPAUSE \-sDEVICE=bbox \-\- $1.ps 2>$1.bbox
1122 cat $1.ps \[rs]
1123 | sed \-e "/\[ha]%%Orientation/r$1.bbox" \[rs]
1124       \-e "/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/" >$1.eps
1125 rm $1.ps $1.bbox
1126 .ft R
1127 .fi
1128 .RE
1129 .
1130 .LP
1131 Just say
1132 .
1133 .IP
1134 .B
1135 groff2eps foo
1136 .
1137 .LP
1138 to convert file
1139 .B foo
1140 to
1141 .BR foo.eps .
1142 .
1143 .
1144 .SS TrueType and other font formats
1145 TrueType fonts can be used with
1146 .B grops
1147 if converted first to
1148 .B "Type\~42"
1149 format, a special PostScript wrapper equivalent to the
1150 PFA format mentioned in
1151 .BR \%pfbtops (@MAN1EXT@).
1152 .
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
1156 .BR gs (1).
1157 .
1158 .LP
1159 Yet, the easiest method involves the use of the application
1160 .BR ttftot42 (1).
1161 .
1162 This program uses
1163 .BR freetype (3)
1164 (version 1.3.1) to generate type42
1165 font wrappers and well-formed AFM files that can be fed to
1166 the
1167 .BR \%afmtodit (@MAN1EXT@)
1168 script to create appropriate metric files.
1169 .
1170 The resulting font wrappers should be added to the
1171 .B download
1172 file.
1173 .B ttftot42
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/
1177 .UE .
1178 .
1179 .LP
1180 Another solution for creating type42 wrappers is to use FontForge,
1181 available from
1182 .UR http://\:fontforge.sf.net
1183 http://\:fontforge.sf.net
1184 .UE .
1185 This font editor can convert most outline font formats.
1186 .
1187 .
1188 .SH FONT INSTALLATION
1189 .
1190 This section gives a summary of the above explanations; it can serve
1191 as a step-by-step font installation guide for
1192 .BR grops .
1193 .
1194 .ds BU \[bu]\ \ \"
1195 .de LI
1196 .IP "" 4
1197 \h'-\w'\*[BU]'u'\*[BU]\c
1198 ..
1199 .LI
1200 Convert your font to something groff understands.
1201 .
1202 This is either a PostScript Type\~1 font in PFA format or a
1203 PostScript Type\~42 font, together with an AFM file.
1204 .
1205 .IP
1206 The very first characters in a PFA file look like this:
1207 .
1208 .RS
1209 .IP
1210 .B %!PS-AdobeFont-1.0:
1211 .RE
1212 .
1213 .IP
1214 A PFB file has this also in the first line, but the string is
1215 preceded with some binary bytes.
1216 .
1217 .IP
1218 The very first characters in a Type\~42 font file look like this:
1219 .
1220 .RS
1221 .IP
1222 .B %!PS-TrueTypeFont
1223 .RE
1224 .
1225 .IP
1226 This is a wrapper format for TrueType fonts.
1227 .
1228 Old PS printers might not support it (this is, they don't have a
1229 built-in TrueType font interpreter).
1230 .
1231 .IP
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.
1236 .
1237 For TrueType fonts, try
1238 .B ttftot42
1239 or
1240 .BR fontforge .
1241 For all other font formats use
1242 .B fontforge
1243 which can convert most outline font formats.
1244 .
1245 .LI
1246 Convert the AFM file to a groff font description file with the
1247 .BR \%afmtodit (@MAN1EXT@)
1248 program.
1249 .
1250 An example call is
1251 .
1252 .RS
1253 .IP
1254 afmtodit Foo-Bar-Bold.afm textmap FBB
1255 .RE
1256 .
1257 .IP
1258 which converts the metric file `Foo-Bar-Bold.afm' to the groff
1259 font `FBB'.
1260 .
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
1263 .BR R ,
1264 .BR B ,
1265 .BR I ,
1266 and
1267 .BR BI ,
1268 respectively, as postfixes in the groff font names to make groff's
1269 `.fam' request work.
1270 .
1271 An example is groff's built-in Times-Roman font: The font family name
1272 is
1273 .BR T ,
1274 and the groff font names are
1275 .BR TR ,
1276 .BR TB ,
1277 .BR TI ,
1278 and
1279 .BR TBI .
1280 .
1281 .LI
1282 Install both the groff font description files and the fonts in a
1283 `devps' subdirectory of the font path which groff finds.
1284 .
1285 See the
1286 .B ENVIRONMENT
1287 section in the
1288 .BR troff (@MAN1EXT@)
1289 man page which lists the actual value of the font path.
1290 .
1291 Note that groff doesn't use the AFM files (but it is a good idea to
1292 store them anyway).
1293 .
1294 .LI
1295 Register all fonts which must be downloaded to the printer in the
1296 `devps/download' file.
1297 .
1298 Only the first occurrence of this file in the font path is read.
1299 .
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.
1302 .
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
1305 .B internalname
1306 field in the `FBB' file), thus the following line should be added to
1307 `download'.
1308 .
1309 .RS
1310 .IP
1311 .B XY-Foo-Bar-Bold Foo-Bar-Bold.pfa
1312 .
1313 .RE
1314 .
1315 .
1316 .SH OLD FONTS
1317 .
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.
1321 .
1322 For backwards compatibility, these old fonts are installed also in the
1323 .
1324 .IP
1325 .BR @OLDFONTDIR@/devps
1326 .
1327 .LP
1328 directory.
1329 .
1330 .LP
1331 To use them, make sure that
1332 .B grops
1333 finds the fonts before the default system fonts (with the same names):
1334 Either add command line option
1335 .B \-F
1336 to
1337 .B grops
1338 .
1339 .IP
1340 .B groff \-Tps \-P\-F \-P@OLDFONTDIR@ .\|.\|.
1341 .
1342 .LP
1343 or add the directory to groff's font path environment variable
1344 .
1345 .IP
1346 .B GROFF_FONT_PATH=@OLDFONTDIR@
1347 .
1348 .
1349 .SH ENVIRONMENT
1350 .
1351 .TP
1352 .SM
1353 .B GROPS_PROLOGUE
1354 If this is set to
1355 .IR foo ,
1356 then
1357 .B grops
1358 uses the file
1359 .I foo
1360 (in the font path) instead of the default prologue file
1361 .BR prologue .
1362 .
1363 The option
1364 .B \-P
1365 overrides this environment variable.
1366 .
1367 .
1368 .TP
1369 .SM
1370 .B GROFF_FONT_PATH
1371 A list of directories in which to search for the
1372 .BI dev name
1373 directory in addition to the default ones.
1374 .
1375 See
1376 .BR @g@troff (@MAN1EXT@)
1377 and
1378 .BR \%groff_font (@MAN5EXT@)
1379 for more details.
1380 .
1381 .
1382 .SH FILES
1383 .
1384 .Tp \w'\fB@FONTDIR@/devps/download'u+2n
1385 .B @FONTDIR@/devps/DESC
1386 Device description file.
1387 .
1388 .TP
1389 .BI @FONTDIR@/devps/ F
1390 Font description file for font
1391 .IR F .
1392 .
1393 .TP
1394 .B @FONTDIR@/devps/download
1395 List of downloadable fonts.
1396 .
1397 .TP
1398 .B @FONTDIR@/devps/text.enc
1399 Encoding used for text fonts.
1400 .
1401 .TP
1402 .B @MACRODIR@/ps.tmac
1403 Macros for use with
1404 .BR grops ;
1405 automatically loaded by
1406 .BR troffrc
1407 .
1408 .TP
1409 .B @MACRODIR@/pspic.tmac
1410 Definition of
1411 .B PSPIC
1412 macro,
1413 automatically loaded by
1414 .BR ps.tmac .
1415 .
1416 .TP
1417 .B @MACRODIR@/psold.tmac
1418 Macros to disable use of characters not present in older
1419 PostScript printers (e.g., `eth' or `thorn').
1420 .
1421 .TP
1422 .BI /tmp/grops XXXXXX
1423 Temporary file.
1424 .
1425 .
1426 .SH "SEE ALSO"
1427 .
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@)
1436 .
1437 .LP
1438 .UR http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf
1439 PostScript Language Document Structuring Conventions Specification
1440 .UE
1441 .
1442 .
1443 .\" Local Variables:
1444 .\" mode: nroff
1445 .\" End: