The 's' argument sets the font size and the button auto-scales itself to match.
Here it is again with s=18:
Note that I draw first a black rectangle and then a white rectangle slightly offset to create
a 3D look. This might be a little hard to see on a light background, but you would adjust your
colours appropriately. And then I do the same with the actual font. I first draw a black version
and then slightly offset draw a white version of the string on top. You can of course play around with
the spacing and colours to get the exact effect you want.
Ok, so how can you do this on your site? You need to make sure that your PHP setup has both GD and TTF
support. See the PHP FAQ
for links to these libraries. It can be
a little tricky getting both GD and TTF support compiled into PHP. I suggest copying libgd.a to /usr/local/lib
and the gd*.h files to /usr/local/include and just do a standard 'make install' for the FreeTTF library which
should stick the appropriate files under /usr/local/lib and /usr/local/include. If you are on Solaris and using
the shared library version of libttf, then you may see an error when you build Apache that says that it can't
find libttf.so. If this is the case, edit the src/modules/php3/libphp3.module file and just before the "-lttf"
add -R/usr/local/lib -L/usr/local/lib. Make sure you do a 'make clean' before trying to rebuild Apache and things
should work ok.
ou can do some very neat things with this.
is just a variation on the above script where I draw a single black letter on a white background. The font itself is
called "Riot Act" and I found it on
. You can use just
about any TTF font. If you have a Windows box sitting around, you can "borrow" any of the .TTF files
in your Windows font directory, or look around on the Net on sites like the one above and download some. Have fun
with it and if you do interesting things with it, let people here know.