PDA

View Full Version : Font Image Generator:please help



s1nykuL
07-21-2010, 07:43 AM
I am looking for a font image generator that will create png or gif images of a supplied truetype font.

I have tried http://sgss.me/obsolete/experiments/phpfontimagegenerator2/

Now this is a good script and works well, but I want the generator to apply a texture to the font from a supplied jpg/bmp/png etc. as well as create font images of a solid colour.

I have googled much but to no avail.

A php script/javascript for realtime rendering or a program which will output png/jpg/gif files, either will do.

Thanks

s1nykuL
07-24-2010, 12:23 PM
I came across this: http://www.imagemagick.org/script/index.php and as I know enough about php to interface with it my problems are solved.

Now isn't the open source community just awesome?

btw the HTML5 <canavas> tag looks very useful for all sorts of graphics based trickery, once Microsoft catch up (http://en.wikipedia.org/wiki/Canvas_element#Support), support allegedly comes with IE 9.

W1zzard
07-24-2010, 11:10 PM
imagemagick is great for such uses and has basically become the industry standard for it. when dynamically creating images for the web consider to cache the generated images on the filesystem otherwise your server load might go through the roof

html canvas is far from ready for production use, maybe in a couple of years

s1nykuL
07-26-2010, 01:14 AM
Thanks W1zzard, I am not sure how caching would help in this instance though for the nature of the site is such that generated images are displayed in the users' browser immediately and used only once, often for less than a second. But this is new ground to me, I have a lot of testing to do and I have a lot to learn in this area.

I am also concerned about allowing user access to the php exec() command. I am reasonably confident of the security of my LAMP server, but the consequences of allowing users access to the php exec() command is currently unknown to me, so it's time for some research.

Any tips gracefully and gratefully accepted.

W1zzard
07-26-2010, 01:20 AM
yes whether caching makes sense depends on your site. i doubt imagemagick can be used for near real time rendering with lots of concurrent users - flash or dhtml is for that


use php's imagemagick api or make sure you never ever pass user input into the command line

s1nykuL
07-26-2010, 10:40 AM
yes whether caching makes sense depends on your site. i doubt imagemagick can be used for near real time rendering with lots of concurrent users - flash or dhtml is for that


use php's imagemagick api or make sure you never ever pass user input into the command line

Aye, the server it is to be run upon isn't state of the art either, but the app will have nearly all resources to itself. Still, I'm going to a have to do some serious testing. I expect it will cope with at least 20 concurrent users, which will do for this early stage.

I thought about using the api, but I only need to run two cmd line arguments to the convert command, the variables being provided by user input. The cmd lines are always the same, just different variables. I will be validating user input server side.