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