EPIC WIN
I got it. It required a lot of drawing (on paper
), a lot of math, solving quadratic equations, dealing with loops, re-sampling, and a whole lot of trial and error.
I basically built my own function to draw half of an ellipse. It uses a loop to go through line by line, changing the color every line to give the appearance of a gradient. Most of the work came from getting the correct equation to calculate where to start and stop the line to get a nice, clean curve. I accomplished anti-aliasing by doing this all at 4 times the size needed, then re-sampling it down to normal size.
Here are some results that I created in a few minutes messing around with the variables:
The archive is too large to attach because of the fonts I've included, so you can download it here:
http://www.erikswan.net/signature/eriks-signature-generator-2.5.zip
A quick warning to anyone who's thinking of hosting this: Because everything is being generated with GD (no images except the icons), this version requires quite a bit more processing power. It's not outrageous and I don't think it will have a significant impact on the server compared to the last version, but images will take longer to load when they are generated, and you should watch the server load just to be careful.
There are a lot more query options this time (obviously), so here's the documentation:
Quick note on color options: I made sure that this is backward-compatible with all the signatures already out there, so ?userid=xxx&color=orange will still work as expected - all the previous color presets are already built in.
You should also note that if you are going to specify colors, all of them are required except shadow_color, which will default to white.
Code:
### Available options: ###
type name default description
----------------------------------------------------------------------------------------------------
int userID The ID number of the user
{red, blue, yellow, color blue The color of the background element and text
green, purple, orange,
gray}
{georgia, arial, tahoma, fontface georgia The font of the text. Times is actually Times New Roman.
trebuchetms, times}
string (hex value) bg_color1 Starting color for background gradient
string (hex value) bg_color2 Ending color for background gradient
string (hex value) border_color The color of the border around the background element
string (hex value) text_color The color of the text
string (hex value) shadow_color FFFFFF The color of the text shadow
int shadow_x 1 The x-offset for the text-shadow
int shadow_y 1 The y-offset for the text-shadow
{posts, trophies, likes} elements all 3 Pick elements to show in the badge. You may mix and match, at least one (1) is required
bool showName true If true, will show the Username and a dotted line seperator to the right
bool showXF true If true, will show the small "xF" logo piece to the left of the username
Going to bed for now, hopefully something isn't majorly broken.
Enjoy!