count_admin.html Contents dirstruct.html

Fonts and digits

The counter can use TrueType fonts or digit images for showing counter. At this time it is not a text counter, meaning it only works with graphical web browsers. However I'm planning to add text counter support in future.

TrueType Font

TrueType font support is available from Count version 2.6. TrueType is the scalable font technology built into MS Windows and Macintosh. TrueType was originally developed by Apple for use in their MacOS operating system and later licensed to Microsoft. For some unknown reason Apple was very quiet about TrueType but Microsoft made a big deal out of it. That's why probably lot of people think TrueType was invented by Microsoft. TrueType fonts are cool. These fonts can be drawn at any size without blocky pixelization caused by scaling when using bitmapped fonts. There are a very large number of TrueType fonts available. If you use MS Windows, search for files with ttf extension. You can also download some nice TrueType fonts from this Microsft web page.

Note, the Count version 2.6 has TrueType support ON by default in Makefiles. Here are the steps to add TrueType support to the counter in Unix:

  1. If yo want TrueType font support, download and install the FreeType 1.3.1 font library (FreeType 2.x is not supported yet). The URL is: Note, by default FreeType library is installed as a shared library, if you do not know how to configure your system for shared libraries, compile FreeType library as static, e.g.
    ./configure --disable-shared
    It will make counter binary little bigger but will save you from lots of trouble.

  2. Go to the section Compiling and installing

Counter Parameters related to TTF

Few links about free TrueType fonts: (just to get you started)

Digit Styles (all platforms)

The digits used in this program can be individual GIF files or all the digits can be in a single image strip. This gives you the flexibility of using digits of your choice. If you have individual digit images, they are named as zero.gif, one.gif,.... nine.gif, colon.gif, am.gif, pm.gif, comma.gif, dash.gif, d.gif, h.gif, m.gif and s.gif.If you have an image strip, the strip is named as strip.gif. At run-time, the directory of the images is simply used to specify a different style. Therefore, a single program can display digits of various styles. Here are the supplied digit styles. I will not supply individual digit images anymore. All the styles of digits are supplied as a single image strip. Note the order of the digits (you will know about it later).

Style Image strip Author
A styleA designed by the author. D, H, M, S segment added by Andrew Taylor
B styleB Borrowed from HTML-access counter. (digits/B/strip.gif)
C styleC designed by
D styleD designed by the author
E styleE designed by the author
cd stylecd made by the author on SGI with GIMP running on Linux. D,H,M and S are needed for countdown option.
cdr stylecdr Contributed by Mike Casper.
cdd stylecdd Contributed by Sebastian Hartman
bang stylebang Bangla digits. Made with GIMP by the author.

For a huge collection of GIF digits, check out the Digit Mania page. If you design some cool digits and like to share with others try sending them to Digit Mania instead of me.

This program will work with any digits from the Digit Mania page. To use those digits, create subdirectories say, F, G, H, foo etc. inside the digits directory and rename the images to zero.gif, one.gif..nine.gif. I suggest you create an image strip out of these digits and use it instead of using individual images.

How to use other styles of digits

There are several sites including Digit Mania which maintains a array of collection of GIF digits which can be used with the counter. The counter program can use these digits in 2 ways.
  1. Use a single image strip for digits. This is the default behavior, that is the counter program looks for a image file called strip.gif in digits/style directory by default. Using an image strip is much more efficient than using individual digits, because

  2. use a individual digit image for each digit, for example, zero.gif, one.gif...nine.gif. These digit images reside in the digits/style directory. If you like to use the counter for clock, 3 additional digit images are required, e.g., colon.gif, am.gif and pm.gif. If you want to use comma in your counter digits, another image is required, e.g., comma.gif. If you want to use the counter to display date, one more image is required, e.g., dash.gif. If you collect digits from external source, do not forget to rename the images to zero.gif, one.gif, two.gif, ... nine.gif, colon.gif, am.gif, pm.gif, comma.gif and dash.gif

The section How to create an image strip describes how to create an image strip from individual digit images. If you like to use the individual digits instead, you must use the option istrip=F when you call the counter from web page, because by default istrip=T.

How to create an image strip

If you have individual digit images, you can create an image strip out of them. Image strip reduces disk i/o significantly, because the counter will need to read only one image instead of many and the size of the image in most cases will be less than the combined size of the individual images.

A program called mkstrip is supplied to create the image strip from individual digit images. Another program called extdgts is supplied to extract individual GIF images from the strip.gif (made with mkstrip). extdgts is there to help you out if you need to extract the digit images for some reason.

The programs mkstrip and extdgts compiled automatically and copied to the bin diectory located in counter source directory. Before using them, copy mkstrip and extdgts somewhere in your path, otherwise you'll get error "command not found."

Now, go to the directory where all the individual digit images are and type:

   mkstrip zero.gif one.gif two.gif .... nine.gif colon.gif \
      am.gif pm.gif > strip.gif

Note, the file names are not important but the order is very important. For example, the file names may be 0x.gif, 1x.gif etc.

Create a directory say F inside the digits directory and copy or move the file strip.gif to F. You can use this strip with dd=F.

The above strip can be used for counter and clock but not date. It also can NOT be used if you want to display comma. If you want to use date and comma, you must have the image for comma and dash. For example, the strip of digit style A is created with the command:

    mkstrip zero.gif one.gif ... nine.gif colon.gif am.gif pm.gif comma.gif \
    dash.gif > strip.gif

Please note the order of the images used in arguments carefully. The program mkstrip puts the necessary information in the GIF comment extension about the strip. The counter program parses the comment extension to determine the width of the individual digits in the strip. Therefore, the strip can have digit segments of variable width.

For example, the comment of the image strip of digit style A is:


The leftmost integer 15 indicates there are 15 individual digits in the image and the next colon separated pairs are the location of left and right side of the segment of the individual images from the leftmost edge. If you look carefully you will see that the individual segment of the strip is 15 pixel wide. The height is determined by reading the image. If you use the program mkstrip, you do not need to know anything about the comment, it will be created correctly for you. It is mentioned here because it is possible you obtained a strip from somewhere and you want to add the comment to the image.

count_admin.html Contents dirstruct.html