179543Sru.ig
2151497SruCopyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
3151497Sru  Free Software Foundation, Inc.
475584Sru
575584SruPermission is granted to make and distribute verbatim copies of
675584Sruthis manual provided the copyright notice and this permission notice
775584Sruare preserved on all copies.
875584Sru
975584SruPermission is granted to copy and distribute modified versions of this
1075584Srumanual under the conditions for verbatim copying, provided that the
1175584Sruentire resulting derived work is distributed under the terms of a
1275584Srupermission notice identical to this one.
1375584Sru
1475584SruPermission is granted to copy and distribute translations of this
1575584Srumanual into another language, under the above conditions for modified
1675584Sruversions, except that this permission notice may be included in
1775584Srutranslations approved by the Free Software Foundation instead of in
1875584Sruthe original English.
1975584Sru..
20104862Sru.
21151497Sru.do nr grops_C \n[.C]
22151497Sru.cp 0
23151497Sru.
24104862Sru.mso www.tmac
25104862Sru.
26104862Sru.
2775584Sru.\" Like TP, but if specified indent is more than half
2875584Sru.\" the current line-length - indent, use the default indent.
2975584Sru.de Tp
30114402Sru.  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
31114402Sru.  el .TP "\\$1"
3275584Sru..
33104862Sru.
34114402Sru.de TQ
35114402Sru.  br
36114402Sru.  ns
37114402Sru.  TP \$1
38114402Sru..
39104862Sru.
40114402Sru.de FT
41114402Sru.  if '\\*(.T'ps' .ft \\$1
42114402Sru..
43114402Sru.
44114402Sru.
4575584Sru.TH GROPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
46104862Sru.
47104862Sru.
4875584Sru.SH NAME
4975584Srugrops \- PostScript driver for groff
50104862Sru.
51104862Sru.
5275584Sru.SH SYNOPSIS
5375584Sru.nr a \n(.j
5475584Sru.ad l
5575584Sru.nr i \n(.i
5675584Sru.in +\w'\fBgrops 'u
5775584Sru.ti \niu
5875584Sru.B grops
59104862Sru.
6075584Sru.de OP
61104862Sru.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\%\\$2" "\ ]"
6275584Sru.el .RB "[\ " "\\$1" "\ ]"
6375584Sru..
64104862Sru.
6575584Sru.OP \-glmv
6675584Sru.OP \-b n
6775584Sru.OP \-c n
6875584Sru.OP \-F dir
69151497Sru.OP \-I dir
70104862Sru.OP \-p papersize
7175584Sru.OP \-P prologue
72104862Sru.OP \-w n
7375584Sru.RI "[\ " files\|.\|.\|. "\ ]"
7475584Sru.br
7575584Sru.ad \na
76104862Sru.
7775584Sru.PP
7875584SruIt is possible to have whitespace between a command line option and its
7975584Sruparameter.
80104862Sru.
81104862Sru.
8275584Sru.SH DESCRIPTION
8375584Sru.B grops
8475584Srutranslates the output of GNU
8575584Sru.B troff
8675584Sruto PostScript.
87104862Sru.
8875584SruNormally
8975584Sru.B grops
9075584Srushould be invoked by using the groff command
9175584Sruwith a
9275584Sru.B \-Tps
9375584Sruoption.
94104862Sru.
9575584Sru.if '@DEVICE@'ps' (Actually, this is the default for groff.)
96104862Sru.
9775584SruIf no files are given,
9875584Sru.B grops
9975584Sruwill read the standard input.
100104862Sru.
10175584SruA filename of
10275584Sru.B \-
10375584Sruwill also cause
10475584Sru.B grops
10575584Sruto read the standard input.
106104862Sru.
10775584SruPostScript output is written to the standard output.
108104862Sru.
10975584SruWhen
11075584Sru.B grops
11175584Sruis run by
11275584Sru.B groff
11375584Sruoptions can be passed to
11475584Sru.B grops
11575584Sruusing the
11675584Sru.B groff
11775584Sru.B \-P
11875584Sruoption.
119104862Sru.
120151497Sru.PP
121151497SruNote that
122151497Sru.B grops
123151497Srudoesn't produce a valid document structure (conforming to the Document
124151497SruStructuring Convention) if called with multiple file arguments.
125104862Sru.
126151497SruTo print such concatenated output it is necessary to deactivate DSC
127151497Sruhandling in the printing program or previewer.
128151497Sru.
129151497Sru.
13075584Sru.SH OPTIONS
13175584Sru.TP
13275584Sru.BI \-b n
133114402SruProvide workarounds for older printers, broken spoolers, and previewers.
134104862Sru.
13575584SruNormally
13675584Sru.B grops
137114402Sruproduces output at PostScript LanguageLevel\~2 that conforms to the
138114402SruDocument Structuring Conventions version 3.0.
139104862Sru.
140114402SruSome older printers, spoolers, and previewers can't handle such output.
141104862Sru.
142104862SruThe value of\~\c
14375584Sru.I n
14475584Srucontrols what
14575584Sru.B grops
146114402Srudoes to make its output acceptable to such programs.
147104862Sru.
148104862SruA value of\~0 will cause grops not to employ any workarounds.
149104862Sru.
150114402Sru.IP
151104862SruAdd\~1 if no
152114402Sru.B %%Begin\%Document\%Setup
15375584Sruand
154114402Sru.B %%End\%Document\%Setup
15575584Srucomments should be generated;
15675584Sruthis is needed for early versions of TranScript that get confused by
15775584Sruanything between the
158114402Sru.B %%End\%Prolog
15975584Srucomment and the first
16075584Sru.B %%Page
16175584Srucomment.
162104862Sru.
163114402Sru.IP
164104862SruAdd\~2 if lines in included files beginning with
16575584Sru.B %!
16675584Srushould be stripped out; this is needed for Sun's pageview previewer.
167104862Sru.
168114402Sru.IP
169104862SruAdd\~4 if
17075584Sru.BR %%Page ,
17175584Sru.BR %%Trailer
17275584Sruand
173114402Sru.B %%End\%Prolog
17475584Srucomments should be
17575584Srustripped out of included files; this is needed for spoolers that
17675584Srudon't understand the
177114402Sru.B %%Begin\%Document
17875584Sruand
179114402Sru.B %%End\%Document
18075584Srucomments.
181104862Sru.
182114402Sru.IP
183104862SruAdd\~8 if the first line of the PostScript output should be
18475584Sru.B %!PS-Adobe-2.0
18575584Srurather than
18675584Sru.BR %!PS-Adobe-3.0 ;
18775584Sruthis is needed when using Sun's Newsprint with a printer that requires
18875584Srupage reversal.
189104862Sru.
190114402Sru.IP
191114402SruAdd\~16 if no media size information should be included in the document
192114402Sru(this is, neither use
193114402Sru.B %%Document\%Media
194114402Srunor the
195114402Sru.B setpagedevice
196114402SruPostScript command).
197114402Sru.
198114402SruThis was the behaviour of groff version 1.18.1 and earlier; it is needed
199114402Srufor older printers which don't understand PostScript LanguageLevel\~2.
200114402Sru.
201151497SruIt is also necessary if the output is further processed to get an
202151497Sruencapsulated PS (EPS) file -- see below.
203151497Sru.
204114402Sru.IP
20575584SruThe default value can be specified by a
206104862Sru.
20775584Sru.RS
20875584Sru.IP
20975584Sru.BI broken\  n
210104862Sru.
21175584Sru.LP
21275584Srucommand in the DESC file.
213104862Sru.
214104862SruOtherwise the default value is\~0.
21575584Sru.RE
216104862Sru.
21775584Sru.TP
21875584Sru.BI \-c n
21975584SruPrint
22075584Sru.I n
22175584Srucopies of each page.
222104862Sru.
22375584Sru.TP
224104862Sru.BI \-F dir
225104862SruPrepend directory
226104862Sru.IB dir /dev name
227104862Sruto the search path for prologue, font, and device description files;
228104862Sru.I name
229104862Sruis the name of the device, usually
230104862Sru.BR ps .
231104862Sru.
232104862Sru.TP
23375584Sru.BI \-g
23475584SruGuess the page length.
235104862Sru.
23675584SruThis generates PostScript code that guesses the page length.
237104862Sru.
23875584SruThe guess will be correct only if the imageable area is vertically
23975584Srucentered on the page.
240104862Sru.
24175584SruThis option allows you to generate documents that can be printed
24275584Sruboth on letter (8.5\(mu11) paper and on A4 paper without change.
243104862Sru.
24475584Sru.TP
245151497Sru.BI \-I dir
246151497SruThis option may be used to specify a directory to search for
247151497Srufiles on the command line and files named in 
248151497Sru.B \eX'ps: import'
249151497Sruand
250151497Sru.B \eX'ps: file'
251151497Sruescapes.
252151497SruThe current directory is always searched first.
253151497SruThis option may be specified more than once;
254151497Sruthe directories will be searched in the order specified.
255151497SruNo directory search is performed for files specified using an absolute path.
256151497Sru.
257151497Sru.TP
25875584Sru.B \-l
25975584SruPrint the document in landscape format.
260104862Sru.
26175584Sru.TP
26275584Sru.B \-m
26375584SruTurn manual feed on for the document.
264104862Sru.
26575584Sru.TP
266104862Sru.BI \-p paper-size
267104862SruSet physical dimension of output medium.
268104862Sru.
269104862SruThis overrides the
270114402Sru.BR papersize ,
271114402Sru.BR paperlength ,
272104862Sruand
273114402Sru.B paperwidth
274104862Srucommands in the
275104862Sru.B DESC
276104862Srufile; it accepts the same arguments as the
277104862Sru.B papersize
278104862Srucommand.
279104862Sru.
280114402SruSee
281114402Sru.B groff_font (@MAN5EXT@)
282114402Srufor details.
283114402Sru.
28475584Sru.TP
28575584Sru.BI \-P prologue-file
28675584SruUse the file
28775584Sru.I prologue-file
28875584Sru(in the font path) as the prologue instead of the default prologue file
28975584Sru.BR prologue .
290104862Sru.
29175584SruThis option overrides the environment variable
29275584Sru.SM GROPS_PROLOGUE.
293104862Sru.
29475584Sru.TP
29575584Sru.BI \-w n
29675584SruLines should be drawn using a thickness of
297104862Sru.IR n \~\c
29875584Sruthousandths of an em.
299104862SruIf this option is not given, the line thickness defaults to 0.04\~em.
300104862Sru.
30175584Sru.TP
30275584Sru.B \-v
30375584SruPrint the version number.
304104862Sru.
305104862Sru.
30675584Sru.SH USAGE
30775584SruThere are styles called
30875584Sru.BR R ,
30975584Sru.BR I ,
31075584Sru.BR B ,
31175584Sruand
31275584Sru.B BI
313104862Srumounted at font positions 1 to\~4.
314104862Sru.
31575584SruThe fonts are grouped into families
31675584Sru.BR A ,
31775584Sru.BR BM ,
31875584Sru.BR C ,
31975584Sru.BR H ,
32075584Sru.BR HN ,
32175584Sru.BR N ,
322114402Sru.BR P ,
323104862Sruand\~\c
32475584Sru.B T
32575584Sruhaving members in each of these styles:
326104862Sru.
327104862Sru.RS
32875584Sru.TP
32975584Sru.B AR
33075584Sru.FT AR
33175584SruAvantGarde-Book
33275584Sru.FT
333104862Sru.
334114402Sru.TQ
33575584Sru.B AI
33675584Sru.FT AI
33775584SruAvantGarde-BookOblique
33875584Sru.FT
339104862Sru.
340114402Sru.TQ
34175584Sru.B AB
34275584Sru.FT AB
34375584SruAvantGarde-Demi
34475584Sru.FT
345104862Sru.
346114402Sru.TQ
34775584Sru.B ABI
34875584Sru.FT ABI
34975584SruAvantGarde-DemiOblique
35075584Sru.FT
351104862Sru.
352114402Sru.TQ
35375584Sru.B BMR
35475584Sru.FT BMR
35575584SruBookman-Light
35675584Sru.FT
357104862Sru.
358114402Sru.TQ
35975584Sru.B BMI
36075584Sru.FT BMI
36175584SruBookman-LightItalic
36275584Sru.FT
363104862Sru.
364114402Sru.TQ
36575584Sru.B BMB
36675584Sru.FT BMB
36775584SruBookman-Demi
36875584Sru.FT
369104862Sru.
370114402Sru.TQ
37175584Sru.B BMBI
37275584Sru.FT BMBI
37375584SruBookman-DemiItalic
37475584Sru.FT
375104862Sru.
376114402Sru.TQ
37775584Sru.B CR
37875584Sru.FT CR
37975584SruCourier
38075584Sru.FT
381104862Sru.
382114402Sru.TQ
38375584Sru.B CI
38475584Sru.FT CI
38575584SruCourier-Oblique
38675584Sru.FT
387104862Sru.
388114402Sru.TQ
38975584Sru.B CB
39075584Sru.FT CB
39175584SruCourier-Bold
39275584Sru.FT
393104862Sru.
394114402Sru.TQ
39575584Sru.B CBI
39675584Sru.FT CBI
39775584SruCourier-BoldOblique
39875584Sru.FT
399104862Sru.
400114402Sru.TQ
40175584Sru.B HR
40275584Sru.FT HR
40375584SruHelvetica
40475584Sru.FT
405104862Sru.
406114402Sru.TQ
40775584Sru.B HI
40875584Sru.FT HI
40975584SruHelvetica-Oblique
41075584Sru.FT
411104862Sru.
412114402Sru.TQ
41375584Sru.B HB
41475584Sru.FT HB
41575584SruHelvetica-Bold
41675584Sru.FT
417104862Sru.
418114402Sru.TQ
41975584Sru.B HBI
42075584Sru.FT HBI
42175584SruHelvetica-BoldOblique
42275584Sru.FT
423104862Sru.
424114402Sru.TQ
42575584Sru.B HNR
42675584Sru.FT HNR
42775584SruHelvetica-Narrow
42875584Sru.FT
429104862Sru.
430114402Sru.TQ
43175584Sru.B HNI
43275584Sru.FT HNI
43375584SruHelvetica-Narrow-Oblique
43475584Sru.FT
435104862Sru.
436114402Sru.TQ
43775584Sru.B HNB
43875584Sru.FT HNB
43975584SruHelvetica-Narrow-Bold
44075584Sru.FT
441104862Sru.
442114402Sru.TQ
44375584Sru.B HNBI
44475584Sru.FT HNBI
44575584SruHelvetica-Narrow-BoldOblique
44675584Sru.FT
447104862Sru.
448114402Sru.TQ
44975584Sru.B NR
45075584Sru.FT NR
45175584SruNewCenturySchlbk-Roman
45275584Sru.FT
453104862Sru.
454114402Sru.TQ
45575584Sru.B NI
45675584Sru.FT NI
45775584SruNewCenturySchlbk-Italic
45875584Sru.FT
459104862Sru.
460114402Sru.TQ
46175584Sru.B NB
46275584Sru.FT NB
46375584SruNewCenturySchlbk-Bold
46475584Sru.FT
465104862Sru.
466114402Sru.TQ
46775584Sru.B NBI
46875584Sru.FT NBI
46975584SruNewCenturySchlbk-BoldItalic
47075584Sru.FT
471104862Sru.
472114402Sru.TQ
47375584Sru.B PR
47475584Sru.FT PR
47575584SruPalatino-Roman
47675584Sru.FT
477104862Sru.
478114402Sru.TQ
47975584Sru.B PI
48075584Sru.FT PI
48175584SruPalatino-Italic
48275584Sru.FT
483104862Sru.
484114402Sru.TQ
48575584Sru.B PB
48675584Sru.FT PB
48775584SruPalatino-Bold
48875584Sru.FT
489104862Sru.
490114402Sru.TQ
49175584Sru.B PBI
49275584Sru.FT PBI
49375584SruPalatino-BoldItalic
49475584Sru.FT
495104862Sru.
496114402Sru.TQ
49775584Sru.B TR
49875584Sru.FT TR
49975584SruTimes-Roman
50075584Sru.FT
501104862Sru.
502114402Sru.TQ
50375584Sru.B TI
50475584Sru.FT TI
50575584SruTimes-Italic
50675584Sru.FT
507104862Sru.
508114402Sru.TQ
50975584Sru.B TB
51075584Sru.FT TB
51175584SruTimes-Bold
51275584Sru.FT
513104862Sru.
514114402Sru.TQ
51575584Sru.B TBI
51675584Sru.FT TBI
51775584SruTimes-BoldItalic
51875584Sru.FT
519104862Sru.RE
520104862Sru.
52175584Sru.LP
52275584SruThere is also the following font which is not a member of a family:
523104862Sru.
524104862Sru.RS
52575584Sru.TP
52675584Sru.B ZCMI
52775584Sru.FT ZCMI
52875584SruZapfChancery-MediumItalic
52975584Sru.FT
530104862Sru.RE
531104862Sru.
53275584Sru.LP
53375584SruThere are also some special fonts called
534114402Sru.B S
535114402Srufor the PS Symbol font, and
536114402Sru.BR SS ,
537114402Srucontaining slanted lowercase Greek letters taken from PS Symbol.
538104862Sru.
53975584SruZapf Dingbats is available as
54075584Sru.BR ZD
54175584Sruand a reversed version of ZapfDingbats (with symbols pointing in the opposite
54275584Srudirection) is available as
54375584Sru.BR ZDR ;
54475584Srumost characters in these fonts are unnamed and must be accessed using
545104862Sru.BR \[rs]N .
546104862Sru.
54775584Sru.LP
548104862SruThe default color for
549104862Sru.B \[rs]m
550104862Sruand
551104862Sru.B \[rs]M
552104862Sruis black; for colors defined in the `rgb' color space,
553104862Sru.B setrgbcolor
554104862Sruis used, for `cmy' and `cmyk'
555104862Sru.BR setcmykcolor ,
556104862Sruand for `gray'
557104862Sru.BR setgray .
558114402SruNote that
559114402Sru.B setcmykcolor
560114402Sruis a PostScript LanguageLevel\~2 command and thus not available on some
561114402Sruolder printers.
562104862Sru.
563104862Sru.LP
56475584Sru.B grops
565104862Sruunderstands various X\~commands produced using the
566104862Sru.B \[rs]X
56775584Sruescape sequence;
56875584Sru.B grops
56975584Sruwill only interpret commands that begin with a
57075584Sru.B ps:
57175584Srutag.
572104862Sru.
57375584Sru.TP
574104862Sru.BI \[rs]X'ps:\ exec\  code '
57575584SruThis executes the arbitrary PostScript commands in
57675584Sru.IR code .
577104862Sru.
57875584SruThe PostScript currentpoint will be set to the position of the
579104862Sru.B \[rs]X
58075584Srucommand before executing
58175584Sru.IR code .
582104862Sru.
58375584SruThe origin will be at the top left corner of the page,
584104862Sruand y\~coordinates will increase down the page.
585104862Sru.
586104862SruA procedure\~\c
58775584Sru.B u
58875584Sruwill be defined that converts groff units
58975584Sruto the coordinate system in effect.
590104862Sru.
59175584SruFor example, 
592104862Sru.
59375584Sru.RS
59475584Sru.IP
59575584Sru.B
59675584Sru\&.nr x 1i
59775584Sru.br
59875584Sru.B
599104862Sru\[rs]X'ps: exec \[rs]nx u 0 rlineto stroke'
60075584Sru.br
60175584Sru.RE
602104862Sru.
60375584Sru.IP
60475584Sruwill draw a horizontal line one inch long.
605104862Sru.
60675584Sru.I code
60775584Srumay make changes to the graphics state,
60875584Srubut any changes will persist only to the
60975584Sruend of the page.
610104862Sru.
61175584SruA dictionary containing the definitions specified by the
61275584Sru.B def
61375584Sruand
61475584Sru.B mdef
61575584Sruwill be on top of the dictionary stack.
616104862Sru.
61775584SruIf your code adds definitions to this dictionary,
61875584Sruyou should allocate space for them using
619104862Sru.BI \[rs]X'ps\ mdef \ n '\fR.
620104862Sru.
62175584SruAny definitions will persist only until the end of the page.
622104862Sru.
62375584SruIf you use the
624104862Sru.B \[rs]Y
62575584Sruescape sequence with an argument that names a macro,
62675584Sru.I code
62775584Srucan extend over multiple lines.
628104862Sru.
62975584SruFor example,
630104862Sru.
63175584Sru.RS
63275584Sru.IP
63375584Sru.nf
63475584Sru.ft B
63575584Sru\&.nr x 1i
63675584Sru\&.de y
63775584Sru\&ps: exec
638104862Sru\&\[rs]nx u 0 rlineto
63975584Sru\&stroke
64075584Sru\&..
641104862Sru\&\[rs]Yy
64275584Sru.fi
64375584Sru.ft R
644104862Sru.
64575584Sru.LP
64675584Sruis another way to draw a horizontal line one inch long.
64775584Sru.RE
648104862Sru.
64975584Sru.TP
650104862Sru.BI \[rs]X'ps:\ file\  name '
65175584SruThis is the same as the
65275584Sru.B exec
65375584Srucommand except that the PostScript code is read from file
65475584Sru.IR name .
655104862Sru.
65675584Sru.TP
657104862Sru.BI \[rs]X'ps:\ def\  code '
65875584SruPlace a PostScript definition contained in
65975584Sru.I code
66075584Sruin the prologue.
661104862Sru.
66275584SruThere should be at most one definition per
663104862Sru.B \[rs]X
66475584Srucommand.
665104862Sru.
66675584SruLong definitions can be split over several
667104862Sru.B \[rs]X
66875584Srucommands;
66975584Sruall the
67075584Sru.I code
67175584Sruarguments are simply joined together separated by newlines.
672104862Sru.
67375584SruThe definitions are placed in a dictionary which is automatically
67475584Srupushed on the dictionary stack when an
67575584Sru.B exec
67675584Srucommand is executed.
677104862Sru.
67875584SruIf you use the
679104862Sru.B \[rs]Y
68075584Sruescape sequence with an argument that names a macro,
68175584Sru.I code
68275584Srucan extend over multiple lines.
683104862Sru.
68475584Sru.TP
685104862Sru.BI \[rs]X'ps:\ mdef\  n\ code  '
68675584SruLike
68775584Sru.BR def ,
68875584Sruexcept that
68975584Sru.I code
69075584Srumay contain up to
691104862Sru.IR n \~\c
69275584Srudefinitions.
693104862Sru.
69475584Sru.B grops
69575584Sruneeds to know how many definitions
69675584Sru.I code
69775584Srucontains
69875584Sruso that it can create an appropriately sized PostScript dictionary
69975584Sruto contain them.
700104862Sru.
70175584Sru.TP
702104862Sru.BI \[rs]X'ps:\ import\  file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
70375584SruImport a PostScript graphic from
70475584Sru.IR file .
705104862Sru.
70675584SruThe arguments
70775584Sru.IR llx ,
70875584Sru.IR lly ,
70975584Sru.IR urx ,
71075584Sruand
71175584Sru.I ury
71275584Srugive the bounding box of the graphic in the default PostScript
71375584Srucoordinate system; they should all be integers;
71475584Sru.I llx
71575584Sruand
71675584Sru.I lly
717104862Sruare the x and y\~coordinates of the lower left
71875584Srucorner of the graphic;
71975584Sru.I urx
72075584Sruand
72175584Sru.I ury
722104862Sruare the x and y\~coordinates of the upper right corner of the graphic;
72375584Sru.I width
72475584Sruand
72575584Sru.I height
72675584Sruare integers that give the desired width and height in groff
72775584Sruunits of the graphic.
728104862Sru.
72975584SruThe graphic will be scaled so that it has this width and height
73075584Sruand translated so that the lower left corner of the graphic is
73175584Srulocated at the position associated with
732104862Sru.B \[rs]X
73375584Srucommand.
734104862Sru.
73575584SruIf the height argument is omitted it will be scaled uniformly in the
736104862Srux and y\~directions so that it has the specified width.
737104862Sru.
73875584SruNote that the contents of the
739104862Sru.B \[rs]X
74075584Srucommand are not interpreted by
74175584Sru.BR troff ;
74275584Sruso vertical space for the graphic is not automatically added,
74375584Sruand the
74475584Sru.I width
74575584Sruand
74675584Sru.I height
74775584Sruarguments are not allowed to have attached scaling indicators.
748104862Sru.
74975584SruIf the PostScript file complies with the Adobe Document Structuring
75075584SruConventions and contains a
751114402Sru.B %%Bounding\%Box
75275584Srucomment, then the bounding box can be automatically
75375584Sruextracted from within groff by using the
75475584Sru.B psbb
75575584Srurequest.
756104862Sru.
757114402Sru.IP
758114402SruSee
759114402Sru.BR groff_tmac (@MAN5EXT@)
760114402Srufor a description of the
76175584Sru.B PSPIC
762114402Srumacro which provides a convenient high-level interface for inclusion of
763114402SruPostScript graphics.
764104862Sru.
76575584Sru.TP
766104862Sru.B \[rs]X'ps:\ invis'
767114402Sru.TQ
768104862Sru.B \[rs]X'ps:\ endinvis'
76975584SruNo output will be generated for text and drawing commands
77075584Sruthat are bracketed with these
771104862Sru.B \[rs]X
77275584Srucommands.
773104862Sru.
77475584SruThese commands are intended for use when output from
77575584Sru.B troff
77675584Sruwill be previewed before being processed with
77775584Sru.BR grops ;
77875584Sruif the previewer is unable to display certain characters
77975584Sruor other constructs, then other substitute characters or constructs
78075584Srucan be used for previewing by bracketing them with these
781104862Sru.B \[rs]X
78275584Srucommands.
783104862Sru.
78475584Sru.RS
78575584Sru.LP
78675584SruFor example,
787151497Sru.B \%gxditview
78875584Sruis not able to display a proper
789104862Sru.B \[rs](em
79075584Srucharacter because the standard X11 fonts do not provide it;
79175584Sruthis problem can be overcome by executing the following
79275584Srurequest
793104862Sru.
79475584Sru.IP
79575584Sru.ft B
79675584Sru.nf
797104862Sru\&.char \[rs](em \[rs]X'ps: invis'\[rs]
798104862Sru\[rs]Z'\[rs]v'-.25m'\[rs]h'.05m'\[rs]D'l .9m 0'\[rs]h'.05m''\[rs]
799104862Sru\[rs]X'ps: endinvis'\[rs](em
80075584Sru.ft
80175584Sru.fi
802104862Sru.
80375584Sru.LP
80475584SruIn this case,
805151497Sru.B \%gxditview
80675584Sruwill be unable to display the
807104862Sru.B \[rs](em
80875584Srucharacter and will draw the line,
80975584Sruwhereas
81075584Sru.B grops
81175584Sruwill print the
812104862Sru.B \[rs](em
81375584Srucharacter
814114402Sruand ignore the line (this code is already in file
815114402Sru.B Xps.tmac
816151497Sruwhich will be loaded if a document intended for
817114402Sru.B grops
818114402Sruis previewed with
819151497Sru.BR \%gxditview ).
82075584Sru.RE
821104862Sru.
82275584Sru.LP
82375584SruThe input to
82475584Sru.B grops
82575584Srumust be in the format output by
82675584Sru.BR @g@troff (@MAN1EXT@).
827104862Sru.
82875584SruThis is described in
82975584Sru.BR groff_out (@MAN5EXT@).
830104862Sru.
831114402Sru.LP
832114402SruIn addition, the device and font description files for the device used
83375584Srumust meet certain requirements.
834104862Sru.
83575584SruThe device and font description files supplied for
83675584Sru.B ps
83775584Srudevice meet all these requirements.
838104862Sru.
83975584Sru.BR afmtodit (@MAN1EXT@)
84075584Srucan be used to create font files from AFM files.
841104862Sru.
842104862SruThe resolution must be an integer multiple of\~72 times the
84375584Sru.BR sizescale .
844104862Sru.
84575584SruThe
84675584Sru.B ps
84775584Srudevice uses a resolution of 72000 and a sizescale of 1000.
848104862Sru.
84975584Sru.LP
850114402SruThe device description file must contain a valid paper size; see
851104862Sru.BR groff_font (@MAN5EXT@)
852104862Srufor more information.
853104862Sru.
854114402Sru.LP
85575584SruEach font description file must contain a command
85675584Sru.IP
85775584Sru.BI internalname\  psname
85875584Sru.LP
85975584Sruwhich says that the PostScript name of the font is
86075584Sru.IR psname .
861104862Sru.
86275584SruIt may also contain a command
86375584Sru.IP
86475584Sru.BI encoding\  enc_file
86575584Sru.LP
86675584Sruwhich says that
86775584Sruthe PostScript font should be reencoded using the encoding described in
86875584Sru.IR enc_file ;
86975584Sruthis file should consist of a sequence of lines of the form:
87075584Sru.IP
87175584Sru.I
87275584Srupschar code
87375584Sru.LP
87475584Sruwhere
87575584Sru.I pschar
87675584Sruis the PostScript name of the character,
87775584Sruand
87875584Sru.I code
879114402Sruis its position in the encoding expressed as a decimal integer; valid
880114402Sruvalues are in the range 0 to\~255.
881104862Sru.
882104862SruLines starting with
883104862Sru.B #
884104862Sruand blank lines are ignored.
885104862Sru.
88675584SruThe code for each character given in the font file must correspond
88775584Sruto the code for the character in encoding file, or to the code in the default
88875584Sruencoding for the font if the PostScript font is not to be reencoded.
889104862Sru.
89075584SruThis code can be used with the
891104862Sru.B \[rs]N
89275584Sruescape sequence in
89375584Sru.B troff
89475584Sruto select the character,
89575584Srueven if the character does not have a groff name.
896104862Sru.
89775584SruEvery character in the font file must exist in the PostScript font, and 
89875584Sruthe widths given in the font file must match the widths used
89975584Sruin the PostScript font.
900104862Sru.
90175584Sru.B grops
90275584Sruwill assume that a character with a groff name of
90375584Sru.B space
90475584Sruis blank (makes no marks on the page);
90575584Sruit can make use of such a character to generate more efficient and
90675584Srucompact PostScript output.
907104862Sru.
90875584Sru.LP
909114402SruNote that
91075584Sru.B grops
911114402Sruis able to display all glyphs in a PostScript font, not only 256.
912114402Sru.I enc_file
913114402Sru(or the default encoding if no encoding file specified) just defines the
914114402Sruorder of glyphs for the first 256 characters; all other glyphs are
915114402Sruaccessed with additional encoding vectors which
916114402Sru.B grops
917114402Sruproduces on the fly.
918114402Sru.
919114402Sru.LP
920114402Sru.B grops
92175584Srucan automatically include the downloadable fonts necessary
92275584Sruto print the document.
923114402SruSuch fonts must be in PFA format.
924114402SruUse
925114402Sru.BR pfbtops (@MAN1EXT@)
926114402Sruto convert a Type\~1 font in PFB format.
92775584SruAny downloadable fonts which should, when required, be included by
92875584Sru.B grops
92975584Srumust be listed in the file
93075584Sru.BR @FONTDIR@/devps/download ;
93175584Sruthis should consist of lines of the form
932104862Sru.
93375584Sru.IP
93475584Sru.I
935104862Srufont filename
936104862Sru.
93775584Sru.LP
93875584Sruwhere
93975584Sru.I font
94075584Sruis the PostScript name of the font,
94175584Sruand
94275584Sru.I filename
94375584Sruis the name of the file containing the font;
94475584Srulines beginning with
94575584Sru.B #
94675584Sruand blank lines are ignored;
94775584Srufields may be separated by tabs or spaces;
94875584Sru.I filename
94975584Sruwill be searched for using the same mechanism that is used
95075584Srufor groff font metric files.
951104862Sru.
95275584SruThe
95375584Sru.B download
954104862Srufile itself will also be searched for using this mechanism;
955104862Srucurrently, only the first found file in the font path is used.
956104862Sru.
95775584Sru.LP
95875584SruIf the file containing a downloadable font or imported document
95975584Sruconforms to the Adobe Document Structuring Conventions,
96075584Sruthen
96175584Sru.B grops
96275584Sruwill interpret any comments in the files sufficiently to ensure that its
96375584Sruown output is conforming.
964104862Sru.
96575584SruIt will also supply any needed font resources that are listed in the
96675584Sru.B download
96775584Srufile
96875584Sruas well as any needed file resources.
969104862Sru.
97075584SruIt is also able to handle inter-resource dependencies.
971104862Sru.
97275584SruFor example, suppose that you have a downloadable font called Garamond,
97375584Sruand also a downloadable font called Garamond-Outline
97475584Sruwhich depends on Garamond
97575584Sru(typically it would be defined to copy Garamond's font dictionary,
97675584Sruand change the PaintType),
977114402Sruthen it is necessary for Garamond to appear before Garamond-Outline
97875584Sruin the PostScript document.
979104862Sru.
98075584Sru.B grops
98175584Sruwill handle this automatically
98275584Sruprovided that the downloadable font file for Garamond-Outline
98375584Sruindicates its dependence on Garamond by means of
98475584Sruthe Document Structuring Conventions,
98575584Srufor example by beginning with the following lines
986104862Sru.
98775584Sru.IP
98875584Sru.B
98975584Sru%!PS-Adobe-3.0 Resource-Font
99075584Sru.br
99175584Sru.B
99275584Sru%%DocumentNeededResources: font Garamond
99375584Sru.br
99475584Sru.B
99575584Sru%%EndComments
99675584Sru.br
99775584Sru.B
99875584Sru%%IncludeResource: font Garamond
999104862Sru.
100075584Sru.LP
100175584SruIn this case both Garamond and Garamond-Outline would need to be listed
100275584Sruin the
100375584Sru.B download
100475584Srufile.
1005104862Sru.
100675584SruA downloadable font should not include its own name in a
1007114402Sru.B %%Document\%Supplied\%Resources
100875584Srucomment.
1009104862Sru.
101075584Sru.LP
101175584Sru.B grops
101275584Sruwill not interpret 
1013114402Sru.B %%Document\%Fonts
101475584Srucomments.
1015104862Sru.
101675584SruThe
1017114402Sru.BR %%Document\%Needed\%Resources ,
1018114402Sru.BR %%Document\%Supplied\%Resources ,
1019114402Sru.BR %%Include\%Resource ,
1020114402Sru.BR %%Begin\%Resource ,
102175584Sruand
1022114402Sru.BR %%End\%Resource
102375584Srucomments
102475584Sru(or possibly the old
1025114402Sru.BR %%Document\%Needed\%Fonts ,
1026114402Sru.BR %%Document\%Supplied\%Fonts ,
1027114402Sru.BR %%Include\%Font ,
1028114402Sru.BR %%Begin\%Font ,
102975584Sruand
1030114402Sru.BR %%End\%Font
103175584Srucomments)
103275584Srushould be used.
1033104862Sru.
1034104862Sru.
1035151497Sru.SS Encapsulated PostScript
1036151497Sru.B grops
1037151497Sruitself doesn't emit bounding box information.
1038151497Sru.
1039151497SruWith the help of GhostScript the following commands will produce an
1040151497Sruencapsulated PS file
1041151497Sru.B foo.eps
1042151497Srufrom input file
1043151497Sru.BR foo :
1044151497Sru.
1045151497Sru.IP
1046151497Sru.B
1047151497Srugroff -P-b16 foo > foo.ps
1048151497Sru.br
1049151497Sru.B
1050151497Srugs -dNOPAUSE -sDEVICE=bbox -- foo.ps 2> foo.bbox
1051151497Sru.br
1052151497Sru.B
1053151497Srucat foo.ps | sed \-e '/%%Orientation/rfoo.bbx' > foo.eps
1054151497Sru.br
1055151497Sru.B
1056151497Srurm foo.bbx
1057151497Sru.br
1058151497Sru.
1059151497Sru.
1060151497Sru.
1061104862Sru.SS TrueType fonts
1062104862SruTrueType fonts can be used with 
1063104862Sru.B grops 
1064104862Sruif converted first to 
1065104862Sru.B "Type 42"
1066104862Sruformat, an especial PostScript wrapper equivalent to the
1067104862SruPFA format mentioned in
1068104862Sru.BR pfbtops (@MAN1EXT@).
1069104862SruThere are several different methods to generate a type42 
1070104862Sruwrapper and most of them involve the use of a PostScript
1071104862Sruinterpreter such as Ghostscript \(em see
1072104862Sru.BR gs (1).
1073104862SruYet, the easiest method involves the use of the application 
1074104862Sru.BR ttftot42 .
1075104862SruThis program uses
1076104862Sru.BR freetype (3)
1077104862Sru(version 1.3.1) to generate type42
1078104862Srufont wrappers and well-formed AFM files that can be fed to
1079104862Sruthe
1080104862Sru.BR afmtodit (@MAN1EXT@)
1081104862Sruscript to create appropriate metric files.
1082104862SruThe resulting font wrappers should be added to the
1083104862Sru.B download
1084104862Srufile.
1085104862Sru.B ttftot42
1086104862Srusource code can be downloaded from
1087104862Sru.URL ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/ \
1088104862Sru     ftp://\:www.giga.or.at/\:pub/\:nih/\:ttftot42/ .
1089104862Sru.
1090104862Sru.
109175584Sru.SH ENVIRONMENT
109275584Sru.TP
109375584Sru.SM
109475584Sru.B GROPS_PROLOGUE
109575584SruIf this is set to
109675584Sru.IR foo ,
109775584Sruthen
109875584Sru.B grops
109975584Sruwill use the file
110075584Sru.I foo
110175584Sru(in the font path) instead of the default prologue file
110275584Sru.BR prologue .
1103104862Sru.
110475584SruThe option
110575584Sru.B \-P
110675584Sruoverrides this environment variable.
1107104862Sru.
1108104862Sru.
110975584Sru.SH FILES
111075584Sru.Tp \w'\fB@FONTDIR@/devps/download'u+2n
111175584Sru.B @FONTDIR@/devps/DESC
111275584SruDevice description file.
1113104862Sru.
111475584Sru.TP
111575584Sru.BI @FONTDIR@/devps/ F
111675584SruFont description file for font
111775584Sru.IR F .
1118104862Sru.
111975584Sru.TP
112075584Sru.B @FONTDIR@/devps/download
112175584SruList of downloadable fonts.
1122104862Sru.
112375584Sru.TP
112475584Sru.B @FONTDIR@/devps/text.enc
112575584SruEncoding used for text fonts.
1126104862Sru.
112775584Sru.TP
112875584Sru.B @MACRODIR@/ps.tmac
112975584SruMacros for use with
113075584Sru.BR grops ;
113175584Sruautomatically loaded by
113275584Sru.BR troffrc
1133104862Sru.
113475584Sru.TP
113575584Sru.B @MACRODIR@/pspic.tmac
113675584SruDefinition of
113775584Sru.B PSPIC
113875584Srumacro,
113975584Sruautomatically loaded by
114075584Sru.BR ps.tmac .
1141104862Sru.
114275584Sru.TP
114375584Sru.B @MACRODIR@/psold.tmac
114475584SruMacros to disable use of characters not present in older
114575584SruPostScript printers (e.g. `eth' or `thorn').
1146104862Sru.
114775584Sru.TP
114875584Sru.BI /tmp/grops XXXXXX
114975584SruTemporary file.
1150104862Sru.
1151104862Sru.
115275584Sru.SH "SEE ALSO"
115375584Sru.BR afmtodit (@MAN1EXT@),
115475584Sru.BR groff (@MAN1EXT@),
115575584Sru.BR @g@troff (@MAN1EXT@),
1156114402Sru.BR pfbtops (@MAN1EXT@),
115775584Sru.BR groff_out (@MAN5EXT@),
115875584Sru.BR groff_font (@MAN5EXT@),
1159114402Sru.BR groff_char (@MAN7EXT@),
1160114402Sru.BR groff_tmac (@MAN5EXT@)
116179543Sru.
1162151497Sru.PP
1163151497Sru.URL "http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf" \
1164151497Sru     "PostScript Language Document Structuring Conventions Specification"
1165151497Sru.
1166151497Sru.cp \n[grops_C]
1167151497Sru.
116879543Sru.\" Local Variables:
116979543Sru.\" mode: nroff
117079543Sru.\" End:
1171