Banner

This applet lets you display banners with new, exciting fonts. Banner demonstrates the PCFFont.java class that I wrote to to read in bitmap fonts.

Banner is easy to use. To use it, you first need to unzip pcffont.zip into a directory "pcffont". Next, you need to copy the appropriate font into a directory "pcf". Next, get Banner.class. Finally, add an applet tag to your html file; the following tag generates the above banner.

<applet code="Banner.class" align=middle width=700 height=50>
<param name="font" value="pcf/Goofball20.pcf">
<param name="text" value="You can put your message here!">
<param name="fg" value="blue">
<param name="bg" value="#ff0000">
</applet>

The font and text parameters are required to specify the font file and text string. The fg and bg parameters are optional and specify the foreground and background colors as either a color name or a #rrggbb value. The margin parameter is optional and specifies the number of pixels in the margin between the text and the top of the applet. The delay and step parameters are optional and specify the delay in ms between movements of the banner and the number of pixels to move per step respectively. If step is negative, the text will scroll backwards. If an offset value is specified, the characters will be shifted by this offset. A value of 127 may be useful to get special characters in some fonts. The backwards value will print the string backwards, which is useful in languages such as Hebrew. The source for Banner is here.

Back to my Java PCFFont class page.


WebCounter:
Ken Shirriff: shirriff@eng.sun.com
This page: http://www.righto.com/java/fonts/banner.html
Copyright 1998 Ken Shirriff. Last updated 10/8/98. Java and other Java-based names are trademarks of Sun Microsystems, Inc. and refer to Sun's family of Java-branded technologies. Use of this software is subject to the terms of the license agreement.