This code provides two C interfaces to HBF files: a lightweight one and the one defined in Appendix 2 of the HBF definition. Take your pick. The code appears to work under Unix, MSDOS and VMS. It has a few features not specified in the specification: - if a relative HBF filename is supplied to hbfOpen/HBF_OpenFont, and the environment variable HBFPATH is set, the filename is searched for relative to the directories listed in HBFPATH (separated by colons in Unix, semi-colons in MSDOS, commas in VMS). - if bitmap filenames in the HBF file are relative, they are taken to be relative to the directory containing the HBF file. - if the word "transposed" (or "sideways") is appended to an HBF_CODE_RANGE line, those bitmaps are transposed before being returned to the caller. - if the word "inverted" is appended to an HBF_CODE_RANGE line, those bitmaps are inverted before being returned to the caller. - there are 2 extra functions hbfForEach() and hbfFileName() that have proved useful. The code should work with little change on other systems, except for the two relative filename features mentioned above. To use it, you will need the files hbf.h and hbf.c: - put #include "hbf.h" in any source file using these functions - link your program with the object compiled from hbf.c Normally, the routines fetch each bitmap from the file as it is requested. If you have enough memory to hold the whole bitmap file(s), you could define the symbol IN_MEMORY in the Makefile. This should speed up any program that uses any significant number of bitmaps. If you do this, AND you are running under Unix, you can gzip the bitmap files, saving disk space at the cost of execution time. However, the file names used in the HBF file should be the names before gzipping (i.e. leave off the ".gz"). There are also some sample programs using the interface: hbftest - a simple black-box test program: prints one bitmap hbfcmp - compare the bitmaps of two fonts described by HBF files hbftobdf - convert an HBF file to the X Windows BDF format hbfsample - generate sample bitmaps from a HBF file hbftosubfont - extract an X Windows BDF file for a Plan 9 subfont (Unicode) from an HBF file Another program (not using the interface) is bdftohbf - convert from the X Windows BDF format to an HBF file Feel free to use this code, but please send me any bug fixes or other changes you make, instead of distributing modified versions, so that I can maintain a consistent master copy. -- Ross Paterson Department of Computing, Imperial College, London SW7