Next Up Previous Contents
Next: 2.5.2 Not finding fonts
Up: 2.5 Finding and generating fonts
Previous: 2.5 Finding and generating fonts
[ID index]

2.5.1 Finding fonts

The program searches in up to three places for fonts.

  1. The -fp option (see item `-fp font-path') specifies a colon-separated list of directories which should be searched for font PK files. If this is given on the command line, it overrides...
  2. The DVI2BITMAP_PK_PATH environment variable, if defined, specifies a colon-separated list of directories which are to be searched for PK files.
  3. If the program cannot find fonts using the environment variable, and if it was configured with support for the kpathsea library (see Section 3.1), then it should find PK files using the same mechanism other DVI processors use.

The third method is the ideal - you should build dvi2bitmap using the kpathsea library if possible (see Section 3.1.1 for how to obtain it): it is because other DVI-processing programs like dvips and xdvi are built with the kpathsea library, that you normally never have to worry about where fonts live. The kpathsea library is generally integrated with the font-generation commands, and can be queried using the kpsewhich command.

If you don't, or can't, use the kpathsea library, you have to let dvi2bitmap know where to find fonts. How, then, do you establish a list of directories containing suitable PK files? If your system has the kpsewhich command, then you can ask it where fonts live. As long as you have at least one font built for dvi2bitmap, say cmr10.110pk, then kpsewhich can tell you where it is:

% kpsewhich pk cmr10.110pk
/local2/TeX-local/fonts/pk/ibmvga/public/cm/cmr10.110pk
You can use that to set DVI2BITMAP_PK_PATH as follows.
sh% DVI2BITMAP_PK_PATH=`kpsewhich pk cmr10.110pk | sed 's+/[^/]*$++'`
csh% setenv DVI2BITMAP_PK_PATH `kpsewhich pk cmr10.110pk | sed 's+/[^/]*$++'`
depending on whether you're using a sh-type shell (sh or bash) or a csh-type shell (csh, tcsh). Given that you enabled (or at least, did not disable) font-generation at configure-time, dvi2bitmap should generate missing fonts in future, and place them in this same directory.

How do you build that first font? Try running dvi2bitmap on a simple DVI file, with the options -n -Qg: that makes dvi2bitmap merely examine the list of fonts (-n) and display commands to generate missing fonts (-Qg). Run one of these font-generation commands, then ask kpsewhich where the result is.

It is a good idea to run the dvi2bitmap tests, by giving the command make test in the build directory. If you do, then you will end up with at least cmr10 built using the Metafont mode and point size which dvi2bitmap uses by default (you can change the default Metafont mode: see item `-fm mode' or item `--enable-fontgen '). The test script will also give you an indication of how to set the DVI2BITMAP_PK_PATH variable. Note that the advice this script gives relies on a rather specific assumption about how your font-building script (ie, mktexpk or MakeTeXPK) works: namely that all the fonts built for a particular Metafont mode and size will be placed in the same directory. This is true for for the font-building scripts I know about, but it's not any sort of formal standard, so your local system's behaviour may quite reasonably be different, in which case this script can't offer very reliable help.

There are one or two possible wrinkles with the third method. The path-searching library is very powerful and flexible, but it is possible to be tripped up by its configuration file.

Firstly, the program has to find the configuration file. The program should sort this out for itself at configuration time, but it is possible that you might have to give it some help. If you specify the TEXMFCNF environment variable, setting it to the directory which contains your TEX installation's texmf.cnf file, then this overrides the program's notion of where the configuration should be. You can find this file using the command kpsewhich cnf texmf.cnf.


Next Up Previous Contents
Next: 2.5.2 Not finding fonts
Up: 2.5 Finding and generating fonts
Previous: 2.5 Finding and generating fonts
[ID index]
Dvi2bitmap - convert DVI files to bitmap images
Starlink System Note 71
Norman Gray
14 June 1999. Release 0.9-6. Last updated 12 January 2001