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

Fontconvert

Fontconvert performs manipulations on bitmap fonts: conversion to other formats, merging multiple fonts, adjusting individual characters, moving characters around within a font, ...

The input is either a GF or a PK bitmap font, and in some circumstances, a TFM file. (See section File format abbreviations.) The output varies according to the options specified.

Invoking Fontconvert

In the following sections we describe all the options Fontconvert accepts, grouped according to general function.

Fontconvert output options

The following table describes the options which affect the output file(s) Fontconvert writes. You can specify as many as you like. If you don't specify any, the default is to write nothing at all.

In the following, font-name stands for the root part of the main input file (see section The main input file). The output filenames here are the defaults; you can override them with the `-output-file' option (see section Miscellaneous options).

`-epsf'
Output each character as an Encapsulated PostScript (EPS) file named `font-name-code.eps', where code is the character code (in decimal). This may be useful if the input "font" is actually a collection of images.
`-gf'
Output a GF font `font-name.dpigf', where dpi is the resolution of the input font in dots per inch. If this would overwrite the input file (presumably because it, too, is a GF font), then prepend `x' to the output name. This is mainly useful in conjunction with options that change the characters in the input font in some way.
`-text'
Write the output in a human-readable plain text form to standard output. The bitmap for each character is shown using `*' and ` '. This is an easy way to see what output is being generated, without going to the trouble of running TeX and a DVI driver. (The standard TeX programs GFtype and PKtype, which serve a similar purpose, do not always write the entire bitmap.)
`-tfm'
Write a TFM file to `font-name.tfm'. If a TFM file `font-name.tfm' can be found, it is read, and an `x' is prepended to the output name. If an existing TFM file is found, then Fontconvert uses it (by default) for the TFM header information, and for the ligature and kern information. Unless the `-baseline-adjust', `-column-split', filtering, or randomizing options were specified, Fontconvert also uses it for the character dimensions. (Those options radically change the appearance and size of the characters, so using the dimensions of the originals would be inappropriate.) See section Fontwide information options, for how to specify the global TFM information yourself, overriding the default.

Character selection options

The following table describes the options which affect the set of characters Fontconvert writes.

`-concat font1,font2,...'
After processing the main input file (see section The main input file), process the additional fonts font1, font2, etc. Multiple `-concat' options do combine, e.g., `-concat font1 -concat font2' is the same as `-concat font1,font2'. If a character appears in more than one font, its first appearance is the one that counts. Fontconvert issues a warning about such repeated characters. The design size, resolution, and other global information in the output font is always taken from the main input font, not from the concatenated fonts.
`-column-split charspec@col_1,...,col_n'
Split the input character at position charspec before each of the N columns, thus producing n new characters. The new characters have codes charspec, @math{charspec+1}, ..., @math{charspec+n}. (These character codes are subject to the remapping specified by `-remap'; see below. Any previous characters at those codes are overwritten.) The bitmaps of the new characters are slices from the original character: 0 to column @math{col_1-1}, ..., col_n to the bitmap width. You specify the column numbers in bitmap coordinates, i.e., the first column is numbered zero. To split more than one character, simply specify `-column-split' for each. This option is useful when two different characters in a scanned image of a font were printed so closely together that their images overlap. In this case, Imageto cannot break the characters apart, because they are a single bounding box. But you can split them with this option; you have to use your best judgement for the exact column at which to split. (Probably judicious hand-editing with XBfe (see section XBfe) will be necessary after you do this.)
`-range char1-char2'
Only output characters with codes between char1 and char2, inclusive. (See section Common options, and section Specifying character codes.)
`-omit charspec1,charspec2,...'
Omit the characters with the specified codes (before remapping) from the output. Multiple `-omit' options combine.
`-remap src1:dest1,src2:dest2,...'
For each pair of character specifications src/dest, change the character with code src in the input font to have code dest in the output.

Character manipulation options

The following options affect individual characters.

When any of them are specified, the dimensions of the output character are likely to be quite different than those of the input characters; therefore, Fontconvert does not copy the TFM information (when writing a TFM file) from an existing TFM file.

`-baseline-adjust code1:delta1,code2:delta2,...'
Adjust the baseline of the output (i.e., after remapping) character code by the corresponding delta. A negative delta moves the baseline down, a positive one up. Multiple `-baseline-adjust' options combine.
`-filter-passes passes'
`-filter-size half-cell-size'
`-filter-threshold intensity'
Run each character through an "averaging filter" passes times. This tends to smooth rough edges on characters or irregular curves. By the same token, it tends to shrink or eliminate small features, such as features. Experimentation is necessary to determine the best values for any particular font. For the pixel at coordinate @math{(x,y)}, Fontconvert looks at its neighbors in rows @math{y} - half-cell-size, ..., @math{y-1}, @math{y+1}, ..., @math{y} + half-cell-size, and similarly for the columns. Fontconvert computes the average intensity of this square; if the result is greater than intensity, it outputs a black pixel at @math{(x,y)}; a white one, otherwise. This process is repeated for every pixel in every character, and every character is filtered passes times. The default is to do no filtering, i.e., passes is zero. The default for half-cell-size is one; the default for intensity is @math{.5}.
`-random distance'
`-random-threshold probability'
In every character, randomly move each black pixel. We implemented this as part of our research (to see how much characters could be distorted before they became noticeably harder to read--the answer is a lot), but left it in the program for its amusement value. For each black pixel, a first random number between zero and one is compared to probability. If it is greater, nothing happens. Otherwise, a second random number is chosen, this one between @math{-distance} and distance. The pixel is "moved" that far horizontally. Then repeat for the vertical axis. The default is to do no randomization, i.e., distance is zero. The default for probability is @math{.2}.

Fontwide information options

These options provide a way for you to set the global information in TFM and GF files. They override the default values (which are taken from the input bitmap or TFM files).

`-designsize real'
Set the design size in both the TFM and GF output files to real. You give real in printer's points. You might want to use this after seeing the Metafont or PostScript fonts output by BZRto, and deciding they look too small. For example, the original Garamond type specimen we scanned was (nominally) printed in 30pt. But when scaled down to 10pt via Metafont, the characters looked too small. So we ran Fontconvert with `-designsize=26' on the bitmap font made from the original image, and then reran Limn, BZRto, and Metafont to see the result. (We settled on 26 after several trials.) See section Creating fonts, for a description of all the steps in creating fonts from scanned images.
`-fontdimens fd1:value1,fd2:value2,...'
See section TFM fontdimens.
`-tfm-header name1:value1,name2:value2,...'
Assign each value to the corresponding name in the header information written to the TFM file. The standard TeX names are recognized:
`checksum'
The corresponding value should be an unsigned integer, which should uniquely identify this TFM file. A checksum of zero disables testing. The default is zero.
`designsize'
The corresponding value should be a real number between 1 and 2048 (this limit is in the TFM file format). This overrides (for the TFM output only) the `-designsize' option, if both are specified. The default is the design size of the input.
`codingscheme'
The corresponding value should be a string of length less than 40, containing no parentheses or commas. Again, these restrictions are due to the TFM file format. This coding scheme declares the font's encoding vector. See section Coding scheme map file.

Miscellaneous options

These options are the generic ones accepted by most (in some cases, all) programs. See section Common options.

`-dpi unsigned'
The resolution of the main input font, in pixels per inch.
`-encoding enc-file'
The encoding file to read for the mapping between character names and character codes. See section Encoding files. If enc-file has no suffix, `.enc' is appended. There is no default. Without an encoding file, the options listed in section Character selection options which take character specs will just complain if you supply character names, instead of character codes.
`-help'
Print a usage message. See section Common options.
`-output-file filename'
If filename has a suffix and if only one output file is to be written, write to filename. If filename has a suffix and you've specified options which imply more than one output file, Fontconvert complains and gives up. If filename does not have a suffix, extend filename with whatever is appropriate for the output format(s). In the case of GF and TFM output, if this would overwrite the input, prepend an `x' to the output name. By default, use the name of the main input font for filename.
`-verbose'
Output progress reports.
`-version'
Print the version number.

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