You need PHP with the GD library for this to work. I think this is standard for Unix and OS X, but it isn't for Windows.
If you look at my forums (see sig) there's a universal virtual light coming from 90? (i.e., exact center-top of the screen). Therefore all text and images have shadows accordingly for consistancy.
You can make shadowed text via CSS/HTML, but it will look horrible. The first method, just making two layers, produces just too plain a look. The second, a Microsoft DirectX filter, only works in IE5.5+ and looks absolutely horrible in Windows XP with ClearType.
So, the attached script generates PNG images with shadowed, antialiased text. It's reasonably well commented too if you want to modify it.
Look at the sample URL for how to state parameters. The available parameters are:
Code:
// $bgfile as the background
// $color as the font color
// $shadowcolor as the color of the shadow in HTML hex color format (no leading #)
// $fontname as the TTF filename
// $fontsize as the font's size (note: shouldn't exceed 100px-y!)
// $s as the actual string to display
// $skipshadow (optional) as a flag to disable the shadow
English:
Quote:
bgfile: a .png (must be .png, no .gif, .jpg, etc!) image to use as the background
color: a hex code for the font color without a leading # (000000 is black, FF0000 is red, FFFFFF is white, etc.)
shadowcolor: same as color but used for the shadow color instead
fontname: the filename of a .ttf (true type font) file to use. Your fonts are in C:\Windows\Fonts, just upload the one you want
fontsize: the size of the font to use (not sure if PHP's GD library uses points or pixels for this)
s: the text to actually write
skipshadow: skips rendering the shadow and just draws only the text
There are no template modifications with this release; rather it is a starting point for making all sorts of crazy modifications. Whenever you want to generate an image and display it in a template, just do:
Code:
<img src="createshadowedimage.php?parameters...">
Just remember that like any URL you have to escape strings; i.e., "Some Category" would have to be "Some%20Category" because spaces aren't allowed in URLs.
And finally, this is clearly not a release for the weak. Questions will be answered but I have to assume that you have at least some knowledge of what the hell I'm rambling about.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
// $textoffsetpxx is the x-offset of the main text in pixels
// $textoffsetpxy is the y-offset of the main text in pixels
// $shadowoffsetpxx is the x-offset of the shadow relative to the main text
// $shadowoffsetpxy is the y-offset of the shadow relative to the main text
English:
Quote:
textoffsetpxx: the number of pixels from the left edge horizontally of the image to draw the text
textoffsetpxy: Same as textoffsetpxx, but pixels from the top edge vertically
shadowoffsetpxx: The number of pixels relative to textoffsetpxx horizontally to shift the shadow. For example, -3 would be three pixels to the left. 8 would be 8 to the right. 0 would be no shift.
shadowoffsetpxy: Same as shadowoffsetpxx but a vertical shift. Negative is up, positive is down.