man-pages/man1/grops.1.html
2021-03-31 01:06:50 +01:00

1909 lines
30 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of GROPS</TITLE>
</HEAD><BODY>
<H1>GROPS</H1>
Section: User Commands (1)<BR>Updated: 21 March 2020<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
grops - PostScript driver for groff
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
[ <B>-glmv</B> ]
[ <B>-b </B><I>n</I> ]
[ <B>-c </B><I>n</I> ]
[ <B>-F </B><I>dir</I> ]
[ <B>-I </B><I>dir</I> ]
[ <B>-p </B><I>papersize</I> ]
[ <B>-P </B><I>prologue</I> ]
[ <B>-w </B><I>n</I> ]
[<I>file</I>
...]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>grops</B>
translates the output of GNU
<B>troff</B>
to PostScript.
Normally
<B>grops</B>
should be invoked by using the groff command with a
<B>-Tps</B>
option.
(Actually, this is the default for groff.)
If no files are given,
<B>grops</B>
reads the standard input.
A filename of
<B>-</B>
also causes
<B>grops</B>
to read the standard input.
PostScript output is written to the standard output.
When
<B>grops</B>
is run by
<B>groff</B>
options can be passed to
<B>grops</B>
using
<B>groff</B>'s
<B>-P</B>
option.
<P>
Note that
<B>grops</B>
doesn't produce a valid document structure (conforming to the
Document Structuring Convention) if called with multiple file
arguments.
To print such concatenated output it is necessary to deactivate DSC
handling in the printing program or previewer.
See section "Font Installation" below for a guide how to install
fonts for
<B>grops</B>.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
Whitespace is permitted between a command-line option and its argument.
<DL COMPACT>
<DT id="1"><B>-b</B><I>n</I>
<DD>
Provide workarounds for older printers, broken spoolers, and previewers.
Normally
<B>grops</B>
produces output at PostScript LanguageLevel~2 that conforms to the
Document Structuring Conventions version 3.0.
Some older printers, spoolers, and previewers can't handle such
output.
The value of~<I>n</I>
controls what
<B>grops</B>
does to make its output acceptable to such programs.
A value of~0 causes grops not to employ any workarounds.
<DT id="2"><DD>
Add~1 if no
<B>%%BeginDocumentSetup</B>
and
<B>%%EndDocumentSetup</B>
comments should be generated;
this is needed for early versions of TranScript that get confused by
anything between the
<B>%%EndProlog</B>
comment and the first
<B>%%Page</B>
comment.
<DT id="3"><DD>
Add~2 if lines in included files beginning with
<B>%!</B>
should be stripped out; this is needed for Sun's pageview
previewer.
<DT id="4"><DD>
Add~4 if
<B>%%Page</B>,
<B>%%Trailer</B>
and
<B>%%EndProlog</B>
comments should be
stripped out of included files; this is needed for spoolers that
don't understand the
<B>%%BeginDocument</B>
and
<B>%%EndDocument</B>
comments.
<DT id="5"><DD>
Add~8 if the first line of the PostScript output should be
<B>%!PS-Adobe-2.0</B>
rather than
<B>%!PS-Adobe-3.0</B>;
this is needed when using Sun's Newsprint with a printer that
requires page reversal.
<DT id="6"><DD>
Add~16 if no media size information should be included in the
document (this is, neither use
<B>%%DocumentMedia</B>
nor the
<B>setpagedevice</B>
PostScript command).
This was the behaviour of groff version 1.18.1 and earlier; it is
needed for older printers which don't understand PostScript
LanguageLevel~2.
It is also necessary if the output is further processed to get an
encapsulated PS (EPS) file - see below.
<DT id="7"><DD>
The default value can be specified by a
<DL COMPACT><DT id="8"><DD>
<DL COMPACT>
<DT id="9"><DD>
<B>broken&nbsp;</B><I>n</I>
</DL>
<P>
command in the
<I>DESC</I>
file.
Otherwise the default value is~0.
</DL>
<DT id="10"><B>-c</B><I>n</I>
<DD>
Print
<I>n</I>
copies of each page.
<DT id="11"><B>-F</B><I>dir</I>
<DD>
Prepend directory
dir<I>/dev</I>name
to the search path for prologue, font, and device description files;
<I>name</I>
is the name of the device, usually
<B>ps</B>.
<DT id="12"><B>-g</B>
<DD>
Guess the page length.
This generates PostScript code that guesses the page length.
The guess is correct only if the imageable area is vertically
centered on the page.
This option allows you to generate documents that can be printed
both on letter (8.5&#215;11) paper and on A4 paper without change.
<DT id="13"><B>-I</B><I>dir</I>
<DD>
This option may be used to add a directory to the search path for
files on the command line and files named in
<B>\X'ps: import'</B>
and
<B>\X'ps: file'</B>
escapes.
The search path is initialized with the current directory.
This option may be specified more than once; the directories are then
searched in the order specified (but before the current directory).
If you want to make the current directory be read before other directories,
add
<B>-I.</B>
at the appropriate place.
<DT id="14"><DD>
No directory search is performed for files with an absolute file name.
<DT id="15"><B>-l</B>
<DD>
Print the document in landscape format.
<DT id="16"><B>-m</B>
<DD>
Turn manual feed on for the document.
<DT id="17"><B>-p</B><I>paper-size</I>
<DD>
Set physical dimension of output medium.
This overrides the
<B>papersize</B>,
<B>paperlength</B>,
and
<B>paperwidth</B>
commands in the
<I>DESC</I>
file; it accepts the same arguments as the
<B>papersize</B>
command.
See
<B>groff_font (5)</B>
for details.
<DT id="18"><B>-P</B><I>prologue-file</I>
<DD>
Use the file
<I>prologue-file</I>
(in the font path) as the prologue instead of the default prologue file
<B>prologue</B>.
This option overrides the environment variable
<I>GROPS_PROLOGUE.</I>
<DT id="19"><B>-w</B><I>n</I>
<DD>
Lines should be drawn using a thickness of
<I>n</I>~thousandths of an em.
If this option is not given, the line thickness defaults to 0.04~em.
<DT id="20"><B>-v</B>
<DD>
Print the version number.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>USAGE</H2>
The input to
<B>grops</B>
must be in the format output by
<B><A HREF="/cgi-bin/man/man2html?1+troff">troff</A></B>(1).
This is described in
<B><A HREF="/cgi-bin/man/man2html?5+groff_out">groff_out</A></B>(5).
<P>
In addition, the device and font description files for the device used
must meet certain requirements:
The resolution must be an integer multiple of~72 times the
<B>sizescale</B>.
The
<B>ps</B>
device uses a resolution of 72000 and a sizescale of 1000.
<P>
The device description file must contain a valid paper size; see
<B><A HREF="/cgi-bin/man/man2html?5+groff_font">groff_font</A></B>(5)
for more information.
<P>
Each font description file must contain a command
<DL COMPACT>
<DT id="21"><DD>
<B>internalname&nbsp;</B><I>psname</I>
</DL>
<P>
which says that the PostScript name of the font is
<I>psname</I>.
It may also contain a command
<DL COMPACT>
<DT id="22"><DD>
<B>encoding&nbsp;</B><I>enc_file</I>
</DL>
<P>
which says that
the PostScript font should be reencoded using the encoding described in
<I>enc_file</I>;
this file should consist of a sequence of lines of the form:
<DL COMPACT>
<DT id="23"><DD>
<I>pschar code</I>
</DL>
<P>
where
<I>pschar</I>
is the PostScript name of the character,
and
<I>code</I>
is its position in the encoding expressed as a decimal integer; valid
values are in the range 0 to~255.
Lines starting with
<B>#</B>
and blank lines are ignored.
The code for each character given in the font file must correspond
to the code for the character in encoding file, or to the code in the default
encoding for the font if the PostScript font is not to be reencoded.
This code can be used with the
<B>\N</B>
escape sequence in
<B>troff</B>
to select the character,
even if the character does not have a groff name.
Every character in the font file must exist in the PostScript font, and
the widths given in the font file must match the widths used
in the PostScript font.
<B>grops</B>
assumes that a character with a groff name of
<B>space</B>
is blank (makes no marks on the page);
it can make use of such a character to generate more efficient and
compact PostScript output.
<P>
Note that
<B>grops</B>
is able to display all glyphs in a PostScript font, not only 256.
<I>enc_file</I>
(or the default encoding if no encoding file specified) just defines the
order of glyphs for the first 256 characters; all other glyphs are
accessed with additional encoding vectors which
<B>grops</B>
produces on the fly.
<P>
<B>grops</B>
can automatically include the downloadable fonts necessary
to print the document.
Such fonts must be in PFA format.
Use
<B><A HREF="/cgi-bin/man/man2html?1+pfbtops">pfbtops</A></B>(1)
to convert a Type~1 font in PFB format.
Any downloadable fonts which should, when required, be included by
<B>grops</B>
must be listed in the file
<I>/usr/:share/:groff/:1.22.4/:font/devps/download</I>;
this should consist of lines of the form
<DL COMPACT>
<DT id="24"><DD>
<I>font filename</I>
</DL>
<P>
where
<I>font</I>
is the PostScript name of the font,
and
<I>filename</I>
is the name of the file containing the font;
lines beginning with
<B>#</B>
and blank lines are ignored;
fields may be separated by tabs or spaces;
<I>filename</I>
is searched for using the same mechanism that is used
for groff font metric files.
The
<I>download</I>
file itself is also searched for using this mechanism;
currently, only the first found file in the font path is used.
<P>
If the file containing a downloadable font or imported document
conforms to the Adobe Document Structuring Conventions,
then
<B>grops</B>
interprets any comments in the files sufficiently to ensure that its
own output is conforming.
It also supplies any needed font resources that are listed in the
<I>download</I>
file
as well as any needed file resources.
It is also able to handle inter-resource dependencies.
For example, suppose that you have a downloadable font called
Garamond, and also a downloadable font called Garamond-Outline which
depends on Garamond (typically it would be defined to copy
Garamond's font dictionary, and change the PaintType), then it is
necessary for Garamond to appear before Garamond-Outline in the
PostScript document.
<B>grops</B>
handles this automatically provided that the downloadable font file
for Garamond-Outline indicates its dependence on Garamond by means of
the Document Structuring Conventions, for example by beginning with
the following lines
<DL COMPACT>
<DT id="25"><DD>
<B>%!PS-Adobe-3.0 Resource-Font</B>
<BR>
<B>%%DocumentNeededResources: font Garamond</B>
<BR>
<B>%%EndComments</B>
<BR>
<B>%%IncludeResource: font Garamond</B>
</DL>
<P>
In this case both Garamond and Garamond-Outline would need to be listed
in the
<I>download</I>
file.
A downloadable font should not include its own name in a
<B>%%DocumentSuppliedResources</B>
comment.
<P>
<B>grops</B>
does not interpret
<B>%%DocumentFonts</B>
comments.
The
<B>%%DocumentNeededResources</B>,
<B>%%DocumentSuppliedResources</B>,
<B>%%IncludeResource</B>,
<B>%%BeginResource</B>,
and
<B>%%EndResource</B>
comments
(or possibly the old
<B>%%DocumentNeededFonts</B>,
<B>%%DocumentSuppliedFonts</B>,
<B>%%IncludeFont</B>,
<B>%%BeginFont</B>,
and
<B>%%EndFont</B>
comments)
should be used.
<P>
In the default setup
there are styles called
<B>R</B>,
<B>I</B>,
<B>B</B>,
and
<B>BI</B>
mounted at font positions 1 to~4.
The fonts are grouped into families
<B>A</B>,
<B>BM</B>,
<B>C</B>,
<B>H</B>,
<B>HN</B>,
<B>N</B>,
<B>P</B>,
and~<B>T</B>
having members in each of these styles:
<DL COMPACT><DT id="26"><DD>
<DL COMPACT>
<DT id="27"><B>AR</B>
<DD>
AvantGarde-Book
<B>AI</B>
AvantGarde-BookOblique
<B>AB</B>
AvantGarde-Demi
<B>ABI</B>
AvantGarde-DemiOblique
<B>BMR</B>
Bookman-Light
<B>BMI</B>
Bookman-LightItalic
<B>BMB</B>
Bookman-Demi
<B>BMBI</B>
Bookman-DemiItalic
<B>CR</B>
Courier
<B>CI</B>
Courier-Oblique
<B>CB</B>
Courier-Bold
<B>CBI</B>
Courier-BoldOblique
<B>HR</B>
Helvetica
<B>HI</B>
Helvetica-Oblique
<B>HB</B>
Helvetica-Bold
<B>HBI</B>
Helvetica-BoldOblique
<B>HNR</B>
Helvetica-Narrow
<B>HNI</B>
Helvetica-Narrow-Oblique
<B>HNB</B>
Helvetica-Narrow-Bold
<B>HNBI</B>
Helvetica-Narrow-BoldOblique
<B>NR</B>
NewCenturySchlbk-Roman
<B>NI</B>
NewCenturySchlbk-Italic
<B>NB</B>
NewCenturySchlbk-Bold
<B>NBI</B>
NewCenturySchlbk-BoldItalic
<B>PR</B>
Palatino-Roman
<B>PI</B>
Palatino-Italic
<B>PB</B>
Palatino-Bold
<B>PBI</B>
Palatino-BoldItalic
<B>TR</B>
Times-Roman
<B>TI</B>
Times-Italic
<B>TB</B>
Times-Bold
<B>TBI</B>
Times-BoldItalic
</DL>
</DL>
<P>
There is also the following font which is not a member of a family:
<DL COMPACT><DT id="28"><DD>
<DL COMPACT>
<DT id="29"><B>ZCMI</B>
<DD>
ZapfChancery-MediumItalic
</DL>
</DL>
<P>
There are also some special fonts called
<B>S</B>
for the PS Symbol font, and
<B>SS</B>,
containing slanted lowercase Greek letters taken from PS Symbol.
Zapf Dingbats is available as
<B>ZD</B>,
and a reversed version of ZapfDingbats (with symbols pointing in the opposite
direction) is available as
<B>ZDR</B>;
most characters in these fonts are unnamed and must be accessed using
<B>\N</B>.
<P>
The default color for
<B>\m</B>
and
<B>\M</B>
is black; for colors defined in the 'rgb' color space
<B>setrgbcolor</B>
is used, for 'cmy' and 'cmyk'
<B>setcmykcolor</B>,
and for 'gray'
<B>setgray</B>.
Note that
<B>setcmykcolor</B>
is a PostScript LanguageLevel~2 command and thus not available on some
older printers.
<P>
<B>grops</B>
understands various X~commands produced using the
<B>\X</B>
escape sequence;
<B>grops</B>
only interprets commands that begin with a
<B>ps:</B>
tag.
<DL COMPACT>
<DT id="30"><B>\X'ps:&nbsp;exec&nbsp;</B><I>code</I><B>'</B>
<DD>
This executes the arbitrary PostScript commands in
<I>code</I>.
The PostScript currentpoint is set to the position of the
<B>\X</B>
command before executing
<I>code</I>.
The origin is at the top left corner of the page,
and y~coordinates increase down the page.
A procedure~<B>u</B>
is defined that converts groff units to the coordinate system in
effect (provided the user doesn't change the scale).
For example,
<DL COMPACT><DT id="31"><DD>
<DL COMPACT>
<DT id="32"><DD>
<B>.nr x 1i</B>
<BR>
<B>\X'ps: exec \nx u 0 rlineto stroke'</B>
<BR>
</DL>
</DL>
<DT id="33"><DD>
draws a horizontal line one inch long.
<I>code</I>
may make changes to the graphics state,
but any changes persist only to the end of the page.
A dictionary containing the definitions specified by the
<B>def</B>
and
<B>mdef</B>
is on top of the dictionary stack.
If your code adds definitions to this dictionary,
you should allocate space for them using
<B>\X'ps&nbsp;mdef</B><I>&nbsp;n</I><B>'</B>.
Any definitions persist only until the end of the page.
If you use the
<B>\Y</B>
escape sequence with an argument that names a macro,
<I>code</I>
can extend over multiple lines.
For example,
<DL COMPACT><DT id="34"><DD>
<DL COMPACT>
<DT id="35"><DD>
<PRE>
<B>.nr x 1i
.de y
ps: exec
\nx u 0 rlineto
stroke
..
\Yy
</B></PRE>
</DL>
<P>
is another way to draw a horizontal line one inch long.
Note the single backslash before 'nx' - the only reason to
use a number register while defining the macro 'y' is to
convert a user-specified dimension '1i' to internal groff
units which are in turn converted to PS units with the
<B>u</B>
procedure.
<P>
<B>grops</B>
wraps user-specified PostScript code into a dictionary, nothing more.
In particular, it doesn't start and end the inserted code with
<B>save</B>
and
<B>restore</B>,
respectively.
This must be supplied by the user, if necessary.
</DL>
<DT id="36"><B>\X'ps:&nbsp;file&nbsp;</B><I>name</I><B>'</B>
<DD>
This is the same as the
<B>exec</B>
command except that the PostScript code is read from file
<I>name</I>.
<DT id="37"><B>\X'ps:&nbsp;def&nbsp;</B><I>code</I><B>'</B>
<DD>
Place a PostScript definition contained in
<I>code</I>
in the prologue.
There should be at most one definition per
<B>\X</B>
command.
Long definitions can be split over several
<B>\X</B>
commands;
all the
<I>code</I>
arguments are simply joined together separated by newlines.
The definitions are placed in a dictionary which is automatically
pushed on the dictionary stack when an
<B>exec</B>
command is executed.
If you use the
<B>\Y</B>
escape sequence with an argument that names a macro,
<I>code</I>
can extend over multiple lines.
<DT id="38"><B>\X'ps:&nbsp;mdef&nbsp;</B><I>n&nbsp;code</I><B>'</B>
<DD>
Like
<B>def</B>,
except that
<I>code</I>
may contain up to
<I>n</I>~definitions.
<B>grops</B>
needs to know how many definitions
<I>code</I>
contains
so that it can create an appropriately sized PostScript dictionary
to contain them.
<DT id="39"><B>\X'ps:&nbsp;import&nbsp;</B><I>file&nbsp;llx&nbsp;lly&nbsp;urx&nbsp;ury&nbsp;width&nbsp;</I>[&nbsp;height&nbsp;]<B>'</B>
<DD>
Import a PostScript graphic from
<I>file</I>.
The arguments
<I>llx</I>,
<I>lly</I>,
<I>urx</I>,
and
<I>ury</I>
give the bounding box of the graphic in the default PostScript
coordinate system; they should all be integers;
<I>llx</I>
and
<I>lly</I>
are the x and y~coordinates of the lower left
corner of the graphic;
<I>urx</I>
and
<I>ury</I>
are the x and y~coordinates of the upper right corner of the graphic;
<I>width</I>
and
<I>height</I>
are integers that give the desired width and height in groff
units of the graphic.
<DT id="40"><DD>
The graphic is scaled so that it has this width and height
and translated so that the lower left corner of the graphic is
located at the position associated with
<B>\X</B>
command.
If the height argument is omitted it is scaled uniformly in the
x and y~directions so that it has the specified width.
<DT id="41"><DD>
Note that the contents of the
<B>\X</B>
command are not interpreted by
<B>troff</B>;
so vertical space for the graphic is not automatically added,
and the
<I>width</I>
and
<I>height</I>
arguments are not allowed to have attached scaling indicators.
<DT id="42"><DD>
If the PostScript file complies with the Adobe Document Structuring
Conventions and contains a
<B>%%BoundingBox</B>
comment, then the bounding box can be automatically
extracted from within groff by using the
<B>psbb</B>
request.
<DT id="43"><DD>
See
<B><A HREF="/cgi-bin/man/man2html?5+groff_tmac">groff_tmac</A></B>(5)
for a description of the
<B>PSPIC</B>
macro which provides a convenient high-level interface for inclusion of
PostScript graphics.
<DT id="44"><B>\X'ps:&nbsp;invis'</B>
<DD>
<B>\X'ps:&nbsp;endinvis'</B>
No output is generated for text and drawing commands
that are bracketed with these
<B>\X</B>
commands.
These commands are intended for use when output from
<B>troff</B>
is previewed before being processed with
<B>grops</B>;
if the previewer is unable to display certain characters
or other constructs, then other substitute characters or constructs
can be used for previewing by bracketing them with these
<B>\X</B>
commands.
<DL COMPACT><DT id="45"><DD>
<P>
For example,
<B>gxditview</B>
is not able to display a proper
<B>\(em</B>
character because the standard X11 fonts do not provide it;
this problem can be overcome by executing the following
request
<DL COMPACT>
<DT id="46"><DD>
<B>
</B><PRE>
.char \(em \X'ps: invis'\
\Z'\v'-.25m'\h'.05m'\D'l .9m 0'\h'.05m''\
\X'ps: endinvis'\(em
</PRE>
</DL>
<P>
In this case,
<B>gxditview</B>
is unable to display the
<B>\(em</B>
character and draws the line,
whereas
<B>grops</B>
prints the
<B>\(em</B>
character
and ignores the line (this code is already in file
<B>Xps.tmac</B>
which is loaded if a document intended for
<B>grops</B>
is previewed with
<B>gxditview</B>).
</DL>
</DL>
<P>
If a PostScript procedure
<B>BPhook</B>
has been defined via a
'<B>ps:&nbsp;def</B>'
or
'<B>ps:&nbsp;mdef</B>'
device command, it is executed at the beginning of every page (before
anything is drawn or written by groff).
For example, to underlay the page contents with the word
'DRAFT' in light gray, you might use
<DL COMPACT><DT id="47"><DD>
<P>
<PRE>
<B>.de XX
ps: def
/BPhook
{ gsave .9 setgray clippath pathbbox exch 2 copy
.5 mul exch .5 mul translate atan rotate pop pop
/NewCenturySchlbk-Roman findfont 200 scalefont setfont
(DRAFT) dup stringwidth pop -.5 mul -70 moveto show
grestore }
def
..
.devicem XX
</B></PRE>
</DL>
<P>
Or, to cause lines and polygons to be drawn with square linecaps
and mitered linejoins instead of the round linecaps and linejoins
normally used by
<B>grops</B>,
use
<DL COMPACT><DT id="48"><DD>
<P>
<PRE>
<B>.de XX
ps: def
/BPhook { 2 setlinecap 0 setlinejoin } def
..
.devicem XX
</B></PRE>
</DL>
<P>
(square linecaps, as opposed to butt linecaps (0 setlinecap),
give true corners in boxed tables even though the lines are
drawn unconnected).
<A NAME="lbAG">&nbsp;</A>
<H3>Encapsulated PostScript</H3>
<B>grops</B>
itself doesn't emit bounding box information.
With the help of Ghostscript the following simple script,
<B>groff2eps</B>,
produces an encapsulated PS file.
<DL COMPACT><DT id="49"><DD>
<P>
<PRE>
<B>#! /bin/sh
groff -P-b16 $1 &gt; $1.ps
gs -dNOPAUSE -sDEVICE=bbox -- $1.ps 2&gt; $1.bbox
sed -e &quot;/ha%%Orientation/r $1.bbox&quot; \
-e &quot;/ha%!PS-Adobe-3.0/s/$/ EPSF-3.0/&quot; $1.ps &gt; $1.eps
rm $1.ps $1.bbox
</B></PRE>
</DL>
<P>
Just say
<DL COMPACT>
<DT id="50"><DD>
<B>groff2eps foo</B>
</DL>
<P>
to convert file
<B>foo</B>
to
<B>foo.eps</B>.
<A NAME="lbAH">&nbsp;</A>
<H3>TrueType and other font formats</H3>
TrueType fonts can be used with
<B>grops</B>
if converted first to
<B>Type~42</B>
format, a special PostScript wrapper equivalent to the PFA format
mentioned in
<B><A HREF="/cgi-bin/man/man2html?1+pfbtops">pfbtops</A></B>(1).
There are several different methods to generate a type42 wrapper and
most of them involve the use of a PostScript interpreter such as
Ghostscript - see
<B><A HREF="/cgi-bin/man/man2html?1+gs">gs</A></B>(1).
<P>
Yet, the easiest method involves the use of the application
<B><A HREF="/cgi-bin/man/man2html?1+ttftot42">ttftot42</A></B>(1).
This program uses
<B><A HREF="/cgi-bin/man/man2html?3+freetype">freetype</A></B>(3)
(version 1.3.1) to generate type42
font wrappers and well-formed AFM files that can be fed to
the
<B><A HREF="/cgi-bin/man/man2html?1+afmtodit">afmtodit</A></B>(1)
script to create appropriate metric files.
The resulting font wrappers should be added to the
<I>download</I>
file.
<B>ttftot42</B>
source code can be downloaded from
<A HREF="ftp://:www.giga.or.at/:pub/:nih/:ttftot42/">ftp://:www.giga.or.at/:pub/:nih/:ttftot42/</A>
<P>
Another solution for creating type42 wrappers is to use FontForge,
available from
<A HREF="http://:fontforge.sf.net">http://:fontforge.sf.net</A>
This font editor can convert most outline font formats.
<A NAME="lbAI">&nbsp;</A>
<H2>FONT INSTALLATION</H2>
This section gives a summary of the above explanations; it can serve
as a step-by-step font installation guide for
<B>grops</B>.
<DL COMPACT>
<DT id="51"><DD>
&bull;&nbsp;&nbsp;
Convert your font to something groff understands.
This is either a PostScript Type~1 font in PFA format or a PostScript
Type~42 font, together with an AFM file.
<DT id="52"><DD>
The very first characters in a PFA file look like this:
<DL COMPACT><DT id="53"><DD>
<DL COMPACT>
<DT id="54"><DD>
<B>%!PS-AdobeFont-1.0:</B>
</DL>
</DL>
<DT id="55"><DD>
A PFB file has this also in the first line, but the string is
preceded with some binary bytes.
<DT id="56"><DD>
The very first characters in a Type~42 font file look like this:
<DL COMPACT><DT id="57"><DD>
<DL COMPACT>
<DT id="58"><DD>
<B>%!PS-TrueTypeFont</B>
</DL>
</DL>
<DT id="59"><DD>
This is a wrapper format for TrueType fonts.
Old PS printers might not support it (this is, they don't have a
built-in TrueType font interpreter).
<DT id="60"><DD>
If your font is in PFB format (such fonts normally have
<I>.pfb</I>
as the file extension), you might use groff's
<B><A HREF="/cgi-bin/man/man2html?1+pfbtops">pfbtops</A></B>(1)
program to convert it to PFA.
For TrueType fonts, try
<B>ttftot42</B>
or
<B>fontforge</B>.
For all other font formats use
<B>fontforge</B>
which can convert most outline font formats.
<DT id="61"><DD>
&bull;&nbsp;&nbsp;
Convert the AFM file to a groff font description file with the
<B><A HREF="/cgi-bin/man/man2html?1+afmtodit">afmtodit</A></B>(1)
program.
An example call is
<DL COMPACT><DT id="62"><DD>
<DL COMPACT>
<DT id="63"><DD>
afmtodit Foo-Bar-Bold.afm textmap FBB
</DL>
</DL>
<DT id="64"><DD>
which converts the metric file
<I>Foo-Bar-Bold.afm</I>
to the groff
font
<I>FBB</I>.
If you have a font family which comes with normal, bold, italic,
and bold italic faces, it is recommended to use the letters
<B>R</B>,
<B>B</B>,
<B>I</B>,
and
<B>BI</B>,
respectively, as postfixes in the groff font names to make groff's
'.fam' request work.
An example is groff's built-in Times-Roman font: The font family
name is
<B>T</B>,
and the groff font names are
<B>TR</B>,
<B>TB</B>,
<B>TI</B>,
and
<B>TBI</B>.
<DT id="65"><DD>
&bull;&nbsp;&nbsp;
Install both the groff font description files and the fonts in a
<I>devps</I>
subdirectory of the font path which groff finds.
See section "Environment" in
<B><A HREF="/cgi-bin/man/man2html?1+troff">troff</A></B>(1)
for the actual value of the font path.
Note that groff doesn't use the AFM files (but it is a good idea
to store them anyway).
<DT id="66"><DD>
&bull;&nbsp;&nbsp;
Register all fonts which must be downloaded to the printer in the
<I>devps/download</I>
file.
Only the first occurrence of this file in the font path is read.
This means that you should copy the default
<I>download</I>
file to the first directory in your font path and add your fonts there.
To continue the above example we assume that the PS font name for
<I>Foo-Bar-Bold.pfa</I>
is 'XY-Foo-Bar-Bold' (the PS font name is stored in the
<B>internalname</B>
field in the
<I>FBB</I>
file),
thus the following line should be added to
<I>download</I>.
<DL COMPACT><DT id="67"><DD>
<DL COMPACT>
<DT id="68"><DD>
<B>XY-Foo-Bar-Bold Foo-Bar-Bold.pfa</B>
</DL>
</DL>
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H2>OLD FONTS</H2>
groff versions 1.19.2 and earlier contain a slightly different set of
the 35 Adobe core fonts; the difference is mainly the lack of the
'Euro' glyph and a reduced set of kerning pairs.
For backwards compatibility, these old fonts are installed also in the
<DL COMPACT>
<DT id="69"><DD>
<I>/usr/:share/:groff/:1.22.4/:oldfont/devps</I>
</DL>
<P>
directory.
<P>
To use them, make sure that
<B>grops</B>
finds the fonts before the default system fonts (with the same names):
Either add command-line option
<B>-F</B>
to
<B>grops</B>
<DL COMPACT>
<DT id="70"><DD>
<B>groff -Tps -P-F -P/usr/:share/:groff/:1.22.4/:oldfont ...</B>
</DL>
<P>
or add the directory to groff's font path environment variable
<DL COMPACT>
<DT id="71"><DD>
<B>GROFF_FONT_PATH=/usr/:share/:groff/:1.22.4/:oldfont</B>
</DL>
<A NAME="lbAK">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<DL COMPACT>
<DT id="72"><I>GROPS_PROLOGUE</I>
<DD>
If this is set to
<I>foo</I>,
then
<B>grops</B>
uses the file
<I>foo</I>
(in the font path) instead of the default prologue file
<B>prologue</B>.
The option
<B>-P</B>
overrides this environment variable.
<DT id="73"><I>GROFF_FONT_PATH</I>
<DD>
A list of directories in which to search for the
<I>dev</I>name
directory in addition to the default ones.
See
<B><A HREF="/cgi-bin/man/man2html?1+troff">troff</A></B>(1)
and
<B><A HREF="/cgi-bin/man/man2html?5+groff_font">groff_font</A></B>(5)
for more details.
<DT id="74"><I>SOURCE_DATE_EPOCH</I>
<DD>
A timestamp (expressed as seconds since the Unix epoch) to use as the
creation timestamp in place of the current time.
</DL>
<A NAME="lbAL">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="75"><I>/usr/:share/:groff/:1.22.4/:font/devps/DESC</I>
<DD>
Device description file.
<DT id="76"><I>/usr/:share/:groff/:1.22.4/:font/devps/</I>F
<DD>
Font description file for font
<I>F</I>.
<DT id="77"><I>/usr/:share/:groff/:1.22.4/:font/devps/download</I>
<DD>
List of downloadable fonts.
<DT id="78"><I>/usr/:share/:groff/:1.22.4/:font/devps/text.enc</I>
<DD>
Encoding used for text fonts.
<DT id="79"><I>/usr/:share/:groff/:1.22.4/:tmac/ps.tmac</I>
<DD>
Macros for use with
<B>grops</B>;
automatically loaded by
<B>troffrc</B>
<DT id="80"><I>/usr/:share/:groff/:1.22.4/:tmac/pspic.tmac</I>
<DD>
Definition of
<B>PSPIC</B>
macro,
automatically loaded by
<I>ps.tmac</I>.
<DT id="81"><I>/usr/:share/:groff/:1.22.4/:tmac/psold.tmac</I>
<DD>
Macros to disable use of characters not present in older
PostScript printers (e.g., 'eth' or 'thorn').
<DT id="82"><I>/tmp/grops</I>XXXXXX
<DD>
Temporary file.
See
<B><A HREF="/cgi-bin/man/man2html?1+groff">groff</A></B>(1)
for details on the location of temporary files.
</DL>
<A NAME="lbAM">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+afmtodit">afmtodit</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+groff">groff</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+troff">troff</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pfbtops">pfbtops</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+groff_out">groff_out</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+groff_font">groff_font</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?7+groff_char">groff_char</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?5+groff_tmac">groff_tmac</A></B>(5)
<P>
PostScript Language Document Structuring Conventions Specification
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="83"><A HREF="#lbAB">NAME</A><DD>
<DT id="84"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="85"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="86"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="87"><A HREF="#lbAF">USAGE</A><DD>
<DL>
<DT id="88"><A HREF="#lbAG">Encapsulated PostScript</A><DD>
<DT id="89"><A HREF="#lbAH">TrueType and other font formats</A><DD>
</DL>
<DT id="90"><A HREF="#lbAI">FONT INSTALLATION</A><DD>
<DT id="91"><A HREF="#lbAJ">OLD FONTS</A><DD>
<DT id="92"><A HREF="#lbAK">ENVIRONMENT</A><DD>
<DT id="93"><A HREF="#lbAL">FILES</A><DD>
<DT id="94"><A HREF="#lbAM">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:15 GMT, March 31, 2021
</BODY>
</HTML>