bdf2biff

[ XITE Reference Manual | XITE home ]

Name

bdf2biff - converts a Bitmap Distribution Format font file into a BIFF image of at least 255 bands

Syntax

 #include <xite/draw.h>

 IMAGE bdf2biff( char bdf_filename[] );

Description

Converts Bitmap Distribution Format files (.bdf files) to a BIFF image of at least 255 bands, each of which contains a character. The foreground pixels in the image will get the value `0`, and the background pixels will get the value `255`.

The function reads from the file `bdf_filename` which must be the name of a Bitmap Distribution Format file. bdf2biff returns the image containing the characters.

All characters in the .bdf file with ENCODING number greater than 0 and less than 256, will be placed in the band with that number in the biff image. Characters with ENCODING number -1 will be placed in bands with numbers larger than 255. If there are numbers between 0 and 255 which have no corresponding character, the band with that number will only contain a single pixel. If there are characters with encoding number not between -1 and 255, the program will write an error message and stop without making the biff image. The ENCODING number of a character is usually the same as the ASCII number.

The x (and y) width of each character, read from the DWIDTH lines in the .bdf file, is kept by the variable xmag (and ymag) in the biff picture, and can be fetched by using the biff library function `Ixmag(band)` (and Iymag(band)). Bandnumbers without a character will have xmag (and ymag) = 65535.

The image info will contain the following:

 #FONT <the font name>
 #CHAR <name of char(glyph) 1> <corresp. bandno>
 #CHAR <name of char(glyph) 2> <corresp. bandno>
  ...        ...                             ...
  ...        ...                             ...
 #CHAR <name of char(glyph) N> <corresp. bandno>

The font name is read from the FONT line in the .bdf file. The names of the characters are read from the STARTCHAR lines.

Author

Øyvind Hillesund, NR, Copyright NR

Developed by

BILD, Norsk Regnesentral, Oslo, Norway

See also

bdf2biff(1)