Can true type fonts be used to write over png images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deva
Forum Newbie
Posts: 7
Joined: Tue Jun 12, 2007 3:18 am

Can true type fonts be used to write over png images

Post by deva »

Hi,

I used imagecreatefrompng("ur.png"),
and created a png image. Function imagettftext($im, $fontsize, $angle, $xc, $yc, $txtcolor, $fontfamily, $text); does not work here. Can i use imagettftext() if i create png images using imagecreatefrompng()? Could any one advise..

thanks,
deva
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

Did you upload the font to a certain directory on your webserver when trying to do this? As it is needed. Check Example 999 on here: http://uk3.php.net/imagettftext

:)
deva
Forum Newbie
Posts: 7
Joined: Tue Jun 12, 2007 3:18 am

using true type fonts over png images

Post by deva »

thanks dale.. yes i uploaded the font.. i saw the example you have mentioned above. the function imagettftext() works well when i use imagecreate(100,100) function. But when i use imagecreatefrompng("ur.png") function, i was able to use only imagestring() function which takes ".gdf" fonts. But i wish to use, ttf fonts. Hence, i like to know, whether its possible to use imagettftext() function while using imagecreatefrompng() function.

thanks,
deva
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

What's your script doing? Is it outputting any errors?
Post Reply