APL Character Set and Browsers
XBM Images

Contents | Previous | Next


This method of displaying APL characters is equivalent to that for using GIF images, except the image files are in XBM format, e.g. to display the "rho" character (signifying the "shape" function), the markup is <img src="rho.xbm">.

Example

shape x

x

Details

XBM is X-window BitMap format. GIF, JPEG, and XBM are the three universal image formats for browsers. GIF files (a standard format popular in the PC world), XBM files (a format popular in the Unix world), and JPEG files are supported as in-line images in most browsers. Either format could be used to produce APL characters. XBM format images only support B&W (black and white) images.

XBM (X Bit Map) is a simple graphics format used primarily in the X Window System, though it is also in limited use on the World Wide Web. Although even the oldest graphical Web browsers (especially in X) are able to display XBM images, their limitations make them an unpopular choice among most Web designers. XBM files are 1-bit (i.e., black and white) images. The white portions of the image are usually displayed as being transparent, which means in most cases the background color or pattern beneath the image shows through.

Also, unlike GIF, JPEG, and many other image formats, an XBM file is not compressed. If you were to open one in a text editor, you would be able to see the coordinates for the image in plain text. Therefore XBM files take up more disk space than similarly sized images of other formats.

On the Web, these limitations have relegated the role of XBM files to very small images, often representing scientific formulas or characters that cannot be displayed in ASCII text (e.g., check marks, Greek letters, and other symbols). They are also frequently used in Web counters.

For example, the symbol "rho" ( ) can be defined as the following sequence of bits. (The XBM format requires that the image bits be defined in reverse order.)

0x7c 01111100
0xcc 11001100
0xc6 11000110
0x66 01100110
0x3e 00111110
0x06 00000110
0x06 00000110
0x06 00000110
0x06 00000110
0x06 00000110

Create the following text file:

#define text_width 8
#define text_height 10
static unsigned char text_bits[] = {
0x7c ,
0xcc ,
0xc6 ,
0x66 ,
0x3e ,
0x06 ,
0x06 ,
0x06 ,
0x06 ,
0x06 };

Give the file a name with the xbm extension, such as rho.xbm, then reference it in a web page using the tag:

<img src="rho.xbm">

References

http://kb.indiana.edu/data/aeks.html

Document from Indiana University which contains useful overview information about XBM format