Font utilities

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 IFI files

An image font information (IFI) file is a text file which describes the contents of an image file. You yourself must create it; as we will see, the information it contains usually cannot be determined automatically.

If your image file is named `foo.img' (or `foo.pbm'), it is customary to name the corresponding IFI file `foo.ifi'. That is what Imageto looks for by default. If you name it something else, you must specify the name with the `-ifi-file' option.

Imageto does not look for an IFI file if either the `-strips' or `-epsf' options were specified.

Each nonblank non-comment line in the IFI file represents a a sequence of bounding boxes in the image, and a corresponding character in the output font. See section 5.2 Common file syntax, for a description of syntax elements common to all data files processed by these programs, including comments.

Each line has one to five entries, separated by spaces and/or tabs. If a line contains fewer than five entries, suitable defaults (as described below) are taken for the missing trailing entries. (It is impossible to supply a value for entry #3, say, without also supplying values for entries #1 and #2.)

Here is the meaning of each entry, in order:

  1. The character name of the output character. Usually, Imageto outputs the bounding boxes from the image as a character in the output font, assigning it the character code of the name as defined in the encoding vector (see section 6.3 Invoking Imageto). However, if the character name is .notdef, or if the character name is not specified in the encoding, Imageto just throws away the bounding boxes. See section 5.3 Encoding files, for general information on encoding files.

  2. An adjustment to the baseline of the output character, as a (possibly signed) decimal number. The default baseline is either the bottom scanline of the image row, or the value you specified with the `-baselines' option. The number given here, in the IFI file, is subtracted from that default. Thus, a positive adjustment moves the baseline up (i.e., moves the character down relative to the typesetting baseline), a negative one down. The default adjustment is zero.

  3. The number of bounding boxes which comprise this character, as a decimal number. The default is one. If this number is negative, it indicates that the bounding boxes for this character are not consecutive in the image; instead, they alternate with the following character. For example, the tail of an italic `j' might protrude to the left of the `i'; then Imageto will find the tail of the `j' first (so it should come first in the IFI file), but it will find the dot of the `i' next. In this case, the bounding box count for both the `i' and the `j' should be -2.

  4. The left side bearing (lsb). Most type specimens unfortunately don't include side bearing information, but if you happen to have such, you can give it here. (GSrenderfont (see section 15. GSrenderfont) uses this feature). The default is zero.

    You can run Charspace (see section 9. Charspace) to add side bearings to a font semi-automatically. This is usually less work than trying to guess at numbers here.

  5. The right side bearing. As with the lsb, the default is zero.

Here is a possible IFI file for the image in 6.1 Imageto usage. We throw away the black line that is the second image row. (Imagine that it is a scanner artifact.)

 
% IFI file for example image.
i 0 2
j 0 2
l
m 1
.notdef % Ignore the black line at the bottom.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]