create image with text and save to folder |
[eluser]Random dude[/eluser]
I'm making a site that shows a lot of Japanese calligraphy. I want to be able to show Japanese calligraphic fonts on the site, therefore the only option is save images of the Japanese characters and then use those images. The goal: After retrieving a Japanese character (a utf-8 string) from the database -create a .png image using the string and a font file, -and then save the image to the filesystem. Can anyone point me in the right direction? All the tutorials I can find on the net focus on sending the created image to the browser which is quite different from what I want to do, so I was wondering if anyone had any resources or ideas they could point me to. Thanks heaps in advance. I guess I'll have to just piece together the above steps separately to reach the correct solution. And cheers to CodeIgniter 2.0! Nicholas.
[eluser]Mat-Moo[/eluser]
If you have a ttf font file, then simply load it, and write the characters to an image with http://php.net/manual/en/function.imagettftext.php that would be the simplest solution. As fasr as sending images to teh browser or to a file, instead of using imagejpeg($im) to write to the screen, use imagejpeg($im, 'filename.jpg'); |
Welcome Guest, Not a member yet? Register Sign In |