summaryrefslogtreecommitdiff
path: root/doc/gsrenderf.texi
blob: 31e818916e9f04352ed21f12ede7159528a4b109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
@c Copyright (C) 1992, 1993, 2004 Free Software Foundation, Inc.
@c This is part of the GNU font utilities manual.
@c For copying conditions, see the file fontutil.texi.

@node GSrenderfont
@chapter GSrenderfont

@pindex gsrenderfont
@cindex converting PostScript fonts to bitmaps
@cindex bitmap fonts, making from PostScript
@cindex PostScript fonts, converting to bitmaps
@cindex previewing @TeX{} documents with PostScript fonts
@cindex DVI files with PostScript fonts, previewing
@cindex @TeX{} documents with PostScript fonts, previewing
@cindex Ghostscript, prerequisite for GSrenderfont

GSrenderfont uses Ghostscript to rasterize a PostScript outline font at
a particular point size and resolution.  The final result is a bitmap
font in PK form, which can be used by any DVI-processing program, unlike
the original PostScript font.  In particular, you can then use your
favorite previewer with @TeX{} documents which use PostScript fonts.

@pindex ghostview
An alternative to using such PK fonts is to use a DVI-to-PostScript
translator and then use Ghostscript or Ghostview directly on the result.
The PostScript file consumes quite a bit of disk space, however; also,
the extra step after running @TeX{} can be quite inconvenient.

@pindex ps2pk
An alternative to using GSrenderfont is the standalone C program
@code{ps2pk}.  It does the same job: rasterizing PostScript fonts.  It
is available by ftp from @samp{ftp.urc.tue.nl}.

@flindex gsrenderfont/main.c
@cindex GSrenderfont, prerequisites for
@pindex awk
@pindex gawk
@pindex bbcount
@pindex gftopk
@pindex tail
@pindex wc
@cindex Imageto, used by GSrenderfont
Besides Ghostscript, GSrenderfont uses @code{gawk} (GNU Awk), the
standard Unix utilities @code{tail} and @code{wc}, the standard @TeX{}
utility @code{gftopk}, another programs from this distribution
(Imageto), and one small program written expressly for it,
@code{bbcount}.  Since this last is of doubtful value for anything but
GSrenderfont, it is not documented here.  See @file{gsrenderfont/main.c}
if you are interested in what it does.

GSrenderfont has nothing in particular to do with the main task of
creating typefaces, but it seemed a small enough job (given the other
programs' existence) and widely enough asked for to be worthwhile.

@menu
* GSrenderfont usage::          Making bitmap fonts from PostScript.
* Invoking GSrenderfont::       Command-line options.
@end menu


@node GSrenderfont usage
@section GSrenderfont usage

@cindex GSrenderfont usage
@cindex usage of GSrenderfont

GSrenderfont needs several bits of information to do its job, as
described in the sections below.

@menu
* Names: GSrenderfont font names.  Supplying PostScript names and filenames.
* Size: GSrenderfont output size.  Specifying the size and resolution.
* Encoding: GSrenderfont encoding.  Specifying the output encoding.
@end menu


@node GSrenderfont font names
@subsection GSrenderfont font names

@cindex font names in GSrenderfont
@cindex GSrenderfont font names
@cindex names of fonts in GSrenderfont

@cindex PostScript font names, as filenames
GSrenderfont needs two names to do its job: the PostScript font name
(e.g., @samp{Times-Roman}), and the output filename (e.g., @file{ptmr}).
(The PostScript font name cannot also be used as the filename because of
its length.  At best, the result would be unwieldy, and at worst,
invalid because of operating system restrictions.)  If the font is not
known to Ghostscript (i.e., in its @file{Fontmap}
@flindex Fontmap
file), then an input filename is also needed.

@opindex -font
@opindex -output-file
You can explicitly specify the first with the @samp{-font} option, the
second with the @samp{-output-file} option, and the third with a
non-option argument.  If you specify them all, as in

@example
gsrenderfont -font=Myfont -out=test myfont.ps
@end example

@noindent then GSrenderfont simply uses what you've given.

@opindex -map
@flindex psfonts.map
@flindex /usr/local/lib/tex/dvips/psfonts.map
@cindex mapping file for PostScript fonts
@cindex PostScript fonts, mapping file for
But if you specify only the font name or the input filename,
GSrenderfont tries to guess the other using a @dfn{mapping file}.  On
each line of this file the first (whitespace-delimited) @dfn{word} is
the filename (possibly preceded by an @samp{r}; @pxref{Top, ,
Introduction, fontname, Filenames for fonts}, for why), the second word
is the PostScript font name, and any remaining stuff is ignored.  Unlike
the other data files, GSrenderfont does not use path searching to find
this file; it just uses the default:

@example
/usr/local/lib/tex/dvips/psfonts.map
@end example

@noindent
unless you specify a different file with the @samp{-map} option.  The
reason for this is that @file{psfonts.map} should contain all the
PostScript fonts in use at your site.

GSrenderfont complains and gives up if you specify neither the
PostScript font name nor the input filename.  It also gives up if it
can't determine the filename from the PostScript name or vice versa.

The default for the output filename is the input filename.


@node GSrenderfont output size
@subsection GSrenderfont output size

@cindex point size of GSrenderfont output
@cindex resolution of GSrenderfont output
@cindex GSrenderfont output, resolution of

@opindex -point-size
@opindex -dpi
For convenience, GSrenderfont allows you to independently specify the
point size and the resolution of the output font: the @samp{-point-size}
option, as an integer in points, and the latter with
@samp{-dpi} in pixels per inch.  The defaults are 10@dmn{pt} and
300@dmn{dpi}.

@cindex PostScript font size, default
@cindex default PostScript font size
Because PostScript fonts are (in practice) linearly scaled, however,
GSrenderfont does not put the point size in the output filename.
Instead, it simply computes the final resolution as the @samp{dpi}
multiplied by the @samp{point-size} divided by 10.  This assumes that
the default size of the fonts as used in @TeX{} is 10@dmn{pt}, which is
true for the PostScript fonts distributed with Dvips.

For example, supposing the output filename is @file{ptmr}, and you
specify @samp{-point-size=12}, the bitmap font will be named
@file{ptmr.360pk}.


@node GSrenderfont encoding
@subsection GSrenderfont encoding

@cindex GSrenderfont output encoding
@cindex encoding, with GSrenderfont
@cindex font encoding, with GSrenderfont

You specify the encoding for the new bitmap font with the
@samp{-encoding} option; the default is to use the encoding of the input
font.  GSrenderfont reads the same encoding files as the other programs.
@xref{Encoding files}.

As with all other data files in the other programs, GSrenderfont
searches for the encoding file using the path specified by the
environment variable @code{FONTUTIL_LIB} if it is set; otherwise it uses
the default path set during compilation.  @xref{Font searching}, for the
details of the path searching algorithm.


@node Invoking GSrenderfont
@section Invoking GSrenderfont

@cindex GSrenderfont options
@cindex invocation of GSrenderfont
@cindex options for GSrenderfont

This section describes the options that GSrenderfont accepts.
@xref{Command-line options}, for general option syntax.

You must specify either @samp{-font} or a single non-option
argument, so GSrenderfont knows what font to work on.  See the previous
section for more details.

@table @samp

@opindex -dpi
@item -dpi @var{unsigned}
Render the output at a resolution of @var{unsigned} pixels per inch;
default is 300.

@opindex -encoding
@cindex data file searching
@item -encoding @var{scheme}
Read @file{@var{scheme}.enc} to define the encoding of the output font;
default is @file{dvips}.

@opindex -font
@item -font @var{FontName}
Render the PostScript font @var{FontName} (e.g., @samp{Times-Roman}).

@opindex -help
@item -help
Print a usage message.  @xref{Common options}.

@opindex -map
@flindex psfonts.map
@item -map @var{filename}
Use @var{filename} for the filename-to-PostScript name mapping file;
default is

@example
/usr/local/lib/tex/dvips/psfonts.map
@end example

@item -output-file @var{filename}
@opindex -output-file
@cindex output file, naming
Use @file{@var{filename}.@var{dpi}pk} for the final PK output.

@opindex -point-size
@item -point-size @var{unsigned}
Render the output at @var{unsigned} points; default is 10.

@opindex -verbose
@item -verbose
Output progress reports.

@opindex -version
@item -version
Print the version number.

@end table