Look around the WWW Lab After looking around the network at a number of differnet counters and hearing the various faults which exists for various counters, I decided to write my own simple counter. (See Anthony's WWW Counter)
The result is a quite small counter perl script (mostly comments explaining its use) which calls on the PbmPlus filter library to concatanate the various images of the digits (stored in the pbmplus ``.ppm'' format) and convert it to the GIF format to the calling web client.
In other words. The perl script avoids the image handling and instead concentrates on the counter format. By doing this you can use ANY set of images (pre-converted to ``.ppm'') of any size to generate the counter wanted.
Here are a examples of some of the counter fonts current on this system.
Other fonts can be found in the AIcons Library ``prog/fonts'' sub-directory, though you still need to format them for actual use. All the fonts above are part of the counter images archive.The Default Counter Format. An odometer Font using a %08u printf format. The defaults of course could be set anything you like when installing.
But ALL defaults, such as the font used, font source directory, counter format, etc can all be modified on a per counter basis.
Here for example is another counter with only a change in the font (image prefix)
Blue Bubble Font with %u format (no leading zeros or spaces). I used this font with a %8u (8 characters with leading spaces) in the castle foyer (see below).
Note that while each of the above counters may show the same count, they are actually separate counters. My program can not use a different font or format on the same counter though that could be arranged easily. Of course you can make separate counter (and ".dat" file) using a symbolic link.
Also to display at a counter image without incrementing the ".cnt" data, a separate program (actually the same program renamed or symbolically linked) must be called. This cgi-bin program is "counter-noinc".
Thus the counter in the castle foyer is currently...
![]()
This counter is displayed but NOT incremented using the "counter-noinc"
program. I also added a border so that you can see the space characters
added by the %8u format used.
By using a fixed size font (32x32 digits) with a specific number of characters I can insure that the output image is a specific size which I can specify WIDTH and HEIGHT options for. By doing this I ensure that while the counter is loading the rest of the home page is visible (on netscape browsers anyway). Also as the counter is generated it could take some time for the image to be sent to the client, particularly if the machine is running slowly at that time. This can not be done with a proportional font which this counter CAN handle, or without leading spaces or digits (%u format). Because each digit have a different width, the output imge size can vary so the WIDTH of the counter can not be given.