View Full Version : Looking for a text rendering script
SEbasic
Jan 15th 2006, 5:10 am
Does anyone know where I can get one?
Essentially, I need the script to be able to render an image from a string of characters pulled from a DB field.
I also need to be able to choose from the font I want to use, the colour I want the text to turn out, and the size I want it to be.
Does anyone know where I can find a script that does this?
I've looked for a *long* time, but nothing seems to do it right - I'd be happy to pay a bit for it, not a fortune mind - maybe $50 or something, else I'll just get someone to write it...
I assume the GD library is what needs to be used in order to do this in php.
Any help would be *much* appreciated.
T0PS3O
Jan 15th 2006, 5:18 am
So you just need to create images on the fly based on database stored input?
You make it sounds like you actually want to parse the ascii text (what you see when you open a jpg in notepad) so I'm not entirely sure what you want.
If it's just instant image generation (like the KWT graphs) then it's quite simple. I can lend you a book on it or dig out some tutorials. Probably some phpclasses.org classes as well.
SEbasic
Jan 15th 2006, 5:23 am
So you just need to create images on the fly based on database stored input?Right, that's exactly what I want.
With the ability to edit all of the variables like I said.
Any help would be awesome - It'd be worth a beer for sure ;)
T0PS3O
Jan 15th 2006, 5:26 am
Right, gimme 15 and I'll get you some nice and easy PHP scripts.
This link should get you going:
http://phpclasses.fonant.com/browse/class/11.html
T0PS3O
Jan 15th 2006, 5:30 am
Here's a good one (http://phpclasses.fonant.com/browse/package/2341.html):
Seems like what you need...
This class can render one or multiple lines of text on images.
It can layout one or more groups of lines of text along the image. Each group of text can be aligned at the left, center, or right and top, center, or bottom of the image. Each group of text lines can be rendered with justification to the left, center or right.
The text foreground and background colors of text are configurable, as well as the background and border colors of the image.
The text can be rendered using a given TrueType font and and a given size.
The image can generated with a given size and/or output as result of the current script or saved to a file in either GIF, JPEG or PNG formats.
Another one (http://phpclasses.fonant.com/browse/package/1093.html), which can take a jpg as background and add text on top where and how you want it:
This class takes an image file and inserts a text string to it in desired place.
The color and font of text can be determided as class parameter.
SEbasic
Jan 15th 2006, 5:37 am
That looks awesome mate - thanks for that...
I'm gonna havee a play with it now and see if can do what I want.
T0PS3O
Jan 15th 2006, 5:42 am
Scroll down to the T to get a dozen Text to Image classes. Should be a solution for you there.
SEbasic
Jan 15th 2006, 5:44 am
Sorry, don't getcha.
That site has a pretty complex login sequence huh...
Damn it's ad heavy too - But the script looks ideal so far.
T0PS3O
Jan 15th 2006, 5:47 am
phpclasses.org should be a PHP developer's second bookmark, after php.net. Hotscripts.com then number 3. Yeah, the login is funny but it's all free.
I meant that on this (http://phpclasses.fonant.com/browse/class/11.html) page (the Graphics section) if yuo scroll down to the letter T you get to a load of classes called Text to Image. About 80% down that page.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.