RE: [PHP] Beveled text
Interesting, is this for a website? If so have you tried doing the same thing with CSS? Using CSS you could make the site load faster and be more accessible (for instance, you can allow users to choose their own font size, and make it easier for page readers to handle your page). -Javier -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED] Sent: Saturday, November 08, 2003 10:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Beveled text Ashley M. Kirchner wrote: This produces the attached result. Not exactly beveled, but pretty close (and it's the effect I wanted.) Hmm, yes. Attached result gets stripped by the listserv. So, it's also visible here: http://37th.yeehaw.net/phpiscool.png -- H| I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beveled text
Javier Muniz wrote: Interesting, is this for a website? If so have you tried doing the same thing with CSS? Using CSS you could make the site load faster and be more accessible (for instance, you can allow users to choose their own font size, and make it easier for page readers to handle your page). When I originally created the script, it was simply an exercise, to see if I could do it. However, I have since then incorporated it into a site design of mine, where I wanted the headers to be images, dynamically created. So yes, for each page that loads, each header calls this script which then spits out the PNG data. Large overhead, simply because I never bothered looking into doing it with CSS, and also because outputting a PNG image I'm guaranteed it will work, and it will look the way I want it to look (both font type, as well as with layout positioning,) as opposed to dealing with broken browsers and people not seeing the same thing. And also because I can use my fonts, instead of relying on the user having a particular font installed on their system. -- H| I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Beveled text
Ok, that's reasonable. My only suggestion would be to cache the images that your script generates. A good way to do this is to md5 or otherwise hash the arguments to the PNG generation code and then have the code search for a file in a specified directory (/tmp/generated_pngs for instance) with that name before calling gd, if it exists just read out that file, otherwise generate a new one and place it in the directory. This will lower your overhead without adding too much complexity. To spray out the cached version of your PNG use readfile() or something similar. -Javier -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED] Sent: Saturday, November 08, 2003 11:57 PM To: Javier Muniz Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Beveled text Javier Muniz wrote: Interesting, is this for a website? If so have you tried doing the same thing with CSS? Using CSS you could make the site load faster and be more accessible (for instance, you can allow users to choose their own font size, and make it easier for page readers to handle your page). When I originally created the script, it was simply an exercise, to see if I could do it. However, I have since then incorporated it into a site design of mine, where I wanted the headers to be images, dynamically created. So yes, for each page that loads, each header calls this script which then spits out the PNG data. Large overhead, simply because I never bothered looking into doing it with CSS, and also because outputting a PNG image I'm guaranteed it will work, and it will look the way I want it to look (both font type, as well as with layout positioning,) as opposed to dealing with broken browsers and people not seeing the same thing. And also because I can use my fonts, instead of relying on the user having a particular font installed on their system. -- H| I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Beveled text
Hi, is it possible to create a beveled text using GD. Going through all the classes I have not come across any algorithm which explains beveled text. Siddhartha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beveled text
Well, I'm speaking from imagination here but I imagine the effect could be obtained by creating a series of layers to one item in a loop, changing the alpha transparency slightly each time as well as shrinking the size of the image. You'd start with 75ish alpha level and then loop through one level at a time up a to 100 or something like that, shrinking the text gradually and building off the same center each time. Try it and tell me what happens, I am curious. Cheers, Nathan - Original Message - From: Siddhartha Lahiri To: [EMAIL PROTECTED] Sent: Saturday, November 08, 2003 8:45 AM Subject: [PHP] Beveled text Hi, is it possible to create a beveled text using GD. Going through all the classes I have not come across any algorithm which explains beveled text. Siddhartha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Beveled text
You'll have to increase the character spacing as well, so that each character has the same center not just the individual word/phrase. I don't think this is going to be exactly a bevel effect, but on small enough text it might appear like one. -Javier -Original Message- From: Nathan Taylor [mailto:[EMAIL PROTECTED] Sent: Saturday, November 08, 2003 6:02 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Beveled text Well, I'm speaking from imagination here but I imagine the effect could be obtained by creating a series of layers to one item in a loop, changing the alpha transparency slightly each time as well as shrinking the size of the image. You'd start with 75ish alpha level and then loop through one level at a time up a to 100 or something like that, shrinking the text gradually and building off the same center each time. Try it and tell me what happens, I am curious. Cheers, Nathan - Original Message - From: Siddhartha Lahiri To: [EMAIL PROTECTED] Sent: Saturday, November 08, 2003 8:45 AM Subject: [PHP] Beveled text Hi, is it possible to create a beveled text using GD. Going through all the classes I have not come across any algorithm which explains beveled text. Siddhartha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beveled text
Siddhartha Lahiri wrote: Hi, is it possible to create a beveled text using GD. Going through all the classes I have not come across any algorithm which explains beveled text. Siddhartha I take the text, and output it three times. The first time it'll be dark, and shifted down and right. The second time it'll be light, shifted up and left, and the last time it'll be a color in between those two, not shifted. This produces the attached result. Not exactly beveled, but pretty close (and it's the effect I wanted.) -- H| I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beveled text
Ashley M. Kirchner wrote: This produces the attached result. Not exactly beveled, but pretty close (and it's the effect I wanted.) Hmm, yes. Attached result gets stripped by the listserv. So, it's also visible here: http://37th.yeehaw.net/phpiscool.png -- H| I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php