Go to the first, previous, next, last section, table of contents.


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.

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.

An alternative to using GSrenderfont is the standalone C program ps2pk. It does the same job: rasterizing PostScript fonts. It is available by ftp from `ftp.urc.tue.nl'.

Besides Ghostscript, GSrenderfont uses gawk (GNU Awk), the standard Unix utilities tail and wc, the standard TeX utility gftopk, another programs from this distribution (Imageto), and one small program written expressly for it, bbcount. Since this last is of doubtful value for anything but GSrenderfont, it is not documented here. See `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.

GSrenderfont usage

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

GSrenderfont font names

GSrenderfont needs at least two font names to do its job: the PostScript name, e.g., `Times-Roman', and the output filename, e.g., `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 `Fontmap' file), then an input filename is also needed.

You can explicitly specify the first with the `-font' option, the second with the `-output-file' option, and the third with a non-option argument. If you specify them all, as in

gsrenderfont -font=Myfont -out=test myfont.ps

then GSrenderfont simply uses what you've given.

But if you specify only the font name or the input filename, GSrenderfont tries to guess the other using a mapping file. On each line of this file the first (whitespace-delimited) word is the filename (possibly preceded by an `r'; see section `Introduction' in 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:


unless you specify a different file with the `-map' option. The reason for this is that `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.

GSrenderfont output size

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

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 `dpi' multiplied by the `point-size' divided by 10. This assumes that the default size of the fonts as used in TeX is 10pt, which is true for the PostScript fonts distributed with Dvips.

For example, supposing the output filename is `ptmr', and you specify `-point-size=12', the bitmap font will be named `ptmr.360pk'.

GSrenderfont encoding

You specify the encoding for the new bitmap font with the `-encoding' option; the default is to use the encoding of the input font. GSrenderfont reads the same encoding files as the other programs. See section 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 FONTUTIL_LIB if it is set; otherwise it uses the default path set during compilation. See section Font searching, for the details of the path searching algorithm.

Invoking GSrenderfont

This section describes the options that GSrenderfont accepts. See section Command-line options, for general option syntax.

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

`-dpi unsigned'
Render the output at a resolution of unsigned pixels per inch; default is 300.
`-encoding scheme'
Read `scheme.enc' to define the encoding of the output font; default is `dvips'.
`-font FontName'
Render the PostScript font FontName (e.g., `Times-Roman').
Print a usage message. See section Common options.
`-map filename'
Use filename for the filename-to-PostScript name mapping file; default is
`-output-file filename'
Use `filename.dpipk' for the final PK output.
`-point-size unsigned'
Render the output at unsigned points; default is 10.
Output progress reports.
Print the version number.

Go to the first, previous, next, last section, table of contents.