silkText 1.20

Author: manfred.schneiderbauer@world-direct.at
Version: 1.20
Last Updated:
2002-07-17 (Fixed a bug in Lipod). Available fonts for now:   and   and  )
Download 'Save as...' to download
Description: silkText displays a given text 'instantly' in the well-known silkscreen font.
This means that you don't need any graphics or streaming font at all. The bitmap data is included in the script,
and all you need is the script. The script was tested to work in MSIE4, MSIE 5, MSIE 5.5, MSIE 6, Mozilla 1.0, Opera 6.01 and Netscape Navigator 4.79 on Microsoft Windows, and in Mozilla 1.0, Opera 6.01 and Netscape Navigator 4.79 under Linux.
While all versions of Internet Explorer and the 1.0 releases of Mozilla render in a reasonable speed, the rendering is slow (but acceptable) in Opera und unacceptable slow in Netscape Navigator 4. So, I limited the rendering chain for Netscape to 16 characters, which should be enough for, say, a button. If you want to force Netscape to always render just like all the other browsers, use the forceNN4rendering flag. But take care, if you forget to set the spacer gif and you force Netscape to render, the layout will be destroyed.

Read the descriptions for the parameters in this document carefully; you can grab your first silkText calls out of this document's source code and then modify them to your needs.
 
Usage: var outStr=silkText(
text,borderWidth,paddingWidth,borderColor,bgColor,charColor,zoom,spacing,spacerImage,
forceNN4Rendering,hiliteColor,borderHiliteColor,shadowIntensity,shadowX,shadowY,font
);
document.write (outStr);
 
text Text to output; use only the supported chars as defined here:
&AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ0123456789 []^()<>|_-+!?=.:,@/*%#{}~
Two of these are special 'escape-mode' characters: { will output ' and } will output " .
borderWidth Absolute width of the border in pixels; defaults to zero and invisible.
paddingWidth Absolute width of the space between (visible or invisible) border and text; defaults to zero.
borderColor Color of the border
bgColor Background color; format #RRGGBB; defaults to transparent.
charColor Color of the text; format #RRGGBB; defaults to black.
zoom Pixel size; 1 = no zoom, each pixel is 1x1 in size; defaults to 1.
spacing Whitespace width relative to the zoom; defaults to 1.
spacerImage For the script to work in Netscape 4, you need a transparent 1x1 GIF; put the path and file name of this GIF in here; if it's not given, Netscape 4 will output normal text; this makes sense too, since Netscape 4 is _extremely_ slow in rendering the silkText!
forceNN4Rendering If this is set true, _everything_ will be rendered in Netscape 4, also if there is no spacer image. Take care with this option, since NN4 renders extremely slow!
hiliteColor Start color of the background hilite effect. It must be a color value in hex format '#rrggbb', and each of the red, green and blue values must be equal or greater than the corresponding bgColor values. If it is set to false, the background highlight fader will not appear.
Examples, if bgColor is set to #4080d0:
good: #60a0f0, #ff80d0, #60ffff bad: #00ffff, #2060ff, #4060e0
borderHiliteColor Start color of the pixel hilite effect. It must be a color value in hex format '#rrggbb', and each of the red, green and blue values must be equal or greater than the corresponding bgColor values, as in hiliteColor. If it's set to false, the border highlight fader will not appear.
shadowIntensity Intensity of the shadow in percent; if not set, set to 0 or set to false, no shadow will be rendered; Watch out: shadowing more than doubles the rendering time; don't use the shadow if you use a backgroundColor or a border. The shadow is a real, transparent shadow. The shadow works only in Internet Explorer 5.5 and up and in Mozilla / Netscape 6 and up.
shadowY Vertical pixel distance of the shadow relative to the zoom; defaults to 1.
shadowX Horizontal pixel distance of the shadow relative to the zoom; defaults to 1.
font Enables different fonts. Defaults to 0.
Availeble fonts in this version:
0 = Silkscreen
1 = Silkscreen Bold
2 = Lipod