Hello
I am having some problems with imagettftext()
I have this script
[coce]
header("Content-type: image/png");
// Create the image
$im = imagecreate(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
[/code]
and I'm getting this
‰PNG ��� IHDR��������5¬¸â���¨PLTEÿÿÿ€€€���ÏÏÏŸŸŸ¿¿¿ïïïßß߯¯¯PPP???³³³'''```ppp ÃÃÃGGG___@@@www333‹‹‹000ooo}}}§§§µµµ;;;AAA™™™WWWmmmÑÑÑYYY•••///kkk555MMM›››777###SSSƒƒƒ©=dë��“IDAThí™sÚ0ÇcÇÎs%„‘²GºµÝÖ*Ýûñý¿Ù$9&ä”ÞÆúÝ£XærúKJ¢H8Y`ÈNß²[aŽqaçJš(™ÚîéRˆiÈ'ǺºsDdÅz»£`¹ÜL‰ ‡fŸ}$²öà×söðÏ."Nã˜ìñs…SÒ÷¾�ËKö¼¾‚+ò ·Ñ(¬)`Z)5«aþ<Š˜£ñ¦x‹SkJúAøòU©à›åuäš“z"ÈAL•ÁMÈNaaé¬&ã:ËmŸC‚ {~‡,Ṋ\ˆ ãi ÷]Ÿ:Æ]ª¾aKëɦ *öŽ i]*8™üAF!‚™à2%ð0f€[Óeí Aò¤?›ÂÒYŠ £YŠ‚üw|ðÞ×\‚Lú³hq)&µñHô‚äjÚ–5kB5×#‚ø¢@‡~ËZD› «¬ÚídµN¶¬qá-(—eÚ`¯×ð±»ã^p— MXWˆ £°Þ4bŸ·HÀGž-Â]‚Ä�¯ÈŠ¥ì‡UxÉ‘¥~}G·�Ÿ"ŽùRs°«Þw(–»æ™8íIS¾a†ƒ°?ý£“×]U)ë Šq*0¢ŽN»-‚„u¿¼ ðà6aú‡‹vuUÖθϻ'c^犛ŒÏêdÿ-®ÃÙºÊyw³ÃAxªé¥tâßyX6L77ÑŠtò¾aÅDuI#ÆYsµ^û½á *ʘZyã~`¿Ã{Ç5X$ÿûbä7=b¡¬ž+yÁ{üi3_H¶8\¢ûb@A„£ðI¤1ô`����IEND®B`‚
i don't know what i am doing wrong
The arial.ttf font is in the same directory as the script
Thank you !