Make Charsets In GD Fast-N-Easy
[ Make Charsets ]
[ STONED Tag ]
[ Do A Ding ]
[ Embed PHP ] [ Love The GD in You Forever ]
YOU CAN MAKE CHARSETS IN GD!
May 15, 2005
GOT IT Rough draft
I asked these ?'s
Do I need to define the.ttf file for each line of text?
CAUSE I did!
I can make a png but,... even though I changed the script at the top and the bottom to be a jpg I got a blank image square?
I'm not understanding this Yet! LOL
You need to define the script to produce a jpg image by using jpeg in the script. Both at the top and the bottom. Then it will give you a .jpg image of the char-set.
Also your .TTF file must be in the same sub-directory.
It works by "Truncating" the URL.
You can use the php scripts over and over again as "Templates". Just change the ttf file inside of the .php script. I rename the php to the ttf name. Then I T/L, I rename the file with the ttf name and a extension that I coded the charset to be: ,png .jpg .or gif and it changes into a image file.
If you rename the .php file in your FM by using the rename function it will NOT work. BONK blank image square. I also tested transloading a txt file and renaming it with a extension of .jpg as that is what I defined the image format to be. Nope BONK again blank image square.
This is my first swing at a charset. It's very basic. It can be done much better. I was so jazzed I posted it up so you all would catch this GD Graphic fever with me!
Of course fine tune it to your liking!
Do A Ding
Swifty Charset = DETAILED_INSTRUCTS
This has very detailed instructions in the script. It's designed for new scripters learning about GD and PHP. It is basically a template. If you create a template like this you think others might like to use. Please post it or email one of us. Good Templates are always needed!
(' I ', talking to, Me, and Myself. A internal dialog:)
KeyRisT Daug! All those instructions in the file and I can't see what the heck I am working with. You are confusing me more than teaching me. I see all that text and my brain STOPS thinking!
Can I have just darn code PLEASE!?
Yup I'z hear you Me and Myself.
I agree! So here you are.
You can make each line of text different colors, and sizes if you like. In this case it will be images assigned to the letter and number characters of this ding bat.
This is where you start to define the color of the font.
DEFINE A COLOR
$blue = ImageColorAllocate($im, 0x00, 0x00, 0x99);
$green = ImageColorAllocate($im, 0x33, 0x66, 0x00);
$red = ImageColorAllocate($im, 0x99, 0x00, 0x00);
$grey = imagecolorallocate($im, 0x51, 0x51, 0x51);
$black =imagecolorallocate($im, 0, 0, 0);
Then you reference each line of text by using the name of the color. In this example it is grey. You can name your colors whatever you like. You must use that name to call up the correct thing in the script though.
// The text to draw
$text = 'ABCDEFGHI';
// Replace path by your own font path
$font = 'LucSanFaces.ttf';
// Add the text; size, angle, x y
imagettftext($im, 35, 0, 40, 100, $grey, $font,
I use hex color codes because I know them in my head. RGB I do not know at all. Yes they are there. Just a bit different than what we are use to. This is blue #000099
0x00, 0x00, 0x99);
You need to proceed each set of 2 numbers with 0x
Now it looks familiar huh?
Understanding this part of the script
35, 0, 40, 100, $grey,
35 = Size of Text or "Point Size"
40 = 40 pixels indented from the left side
100 = 100 pixels down from the top or north of the page
grey = What color pallet to draw with
You want each letter a different color?
Then you need to write a text string for each one.
Tell it what it is going to be when it grows up to be a image.
Hearts Galore Charset
Zip contains heartsgalore.ttf, php file, txt file, and jpg file
STONED 1st GD-PHP
Tag -N- Tute
Date:Tue, May 17, 2005, 6:47pm
Carved in Stone....
Here you go...the font and the background are in the zip.
Detailed version explained:
I explained most of the various parts
and what they do in this txt file.
The draw part of Sally's script I don't
know how to do. So I didn't explain it.
To put comments in the script preface
each line with a double forward slash
//WRITE COMMENTS LIKE THIS
//FOR EACH LINE OF TEXT
When you have the PHP Stoned tag the way you want it Take the URL that will end in .php and beam it, transload it. When you can rename it name it whatever you like but the extension must be jpg.
You now have a image that you
made from scratch with a script!
If you would rather have Sally's zip.
Please go to her pages.
Embed a PHP File
Yes You Can!
I took this php tag I put together for PK and used the embed tag and placed it in my sig.
I also did the same in this webpage.
Yes! You can Embed a php
12k as a png this file is 24k
Love The GD In You Forever
Tag -N- Tute
Another Sally tag created in GD. With my twist on it.
This tag uses 2 TTF's. One a Dingbat files for the
hearts. The other for the text.