ttf text in PHP error

A

Anonymous

Guest
Well when I went your link and tried it out I got this error:

Code:
<br />
<b>Warning</b>:  Could not find/open font in <b>/home/publixchange/www/banner.php</b> on line <b>7</b><br />
<br />
<b>Warning</b>:  Could not find/open font in <b>/home/publixchange/www/banner.php</b> on line <b>8</b><br />
<br />
<b>Warning</b>:  Could not find/open font in <b>/home/publixchange/www/banner.php</b> on line <b>9</b><br />
‰PNG
So maybe you need to either make sure those fonts are on your server or change the fonts your currently using... But I could be wrong :) its just a guess.
 
8O ummm, hmmmmm, I would ask your server about it... maybe they changed something (unless your the one running your server)
 
shyguy1 said:
Hi, i've created a banner-creation-tool which uses Javascript for color selection and PHP for doing the images. I use 4 scripts taht are doing basically the same job. one is for banner with background, another for banner with background color *2 for jpg and png. The scripts use also TTF fonts for doing the text. Anyway the scripts did their work since a few weeks ago. Now they show a warning that says "could not find/open font in" .
I controlled if the fonts have been deleted or if the access rights have been modified, but everything was like the first time.
I've thought at a PHPversion-change by my provider, but they couldn't help me.

the 1st script is this one: (there's the same error message at all 4 scripts)

--------------------------------

<?php
Header("Content-type: image/png");
$im = imagecreatefrompng("$bg");
$color1 = ImageColorAllocate($im, $r_t1, $g_t1, $b_t1);
$color2 = ImageColorAllocate($im, $r_t2, $g_t2, $b_t2);
$color3 = ImageColorAllocate($im, $r_t3, $g_t3, $b_t3);
ImageTTFText ($im, $size, 0, $posizione, $size+$altezza, $color1, $font1, $string1);
ImageTTFText ($im, $size2, 0, $posizione2, $size2+$altezza2, $color2, $font2, $string2);
ImageTTFText ($im, $size3, 0, $posizione3, $size3+$altezza3, $color3, $font3, $string3);
ImagePng ($im);
ImageDestroy ($im);
?>

--------------------------------

I hope somebody can tell me why the problem appeared and provide me a solution/alternative!

Thank you very much for interesting in my problem,
Magnus Moosreiner

URL: http://bannercreator.publixchange.net

Hi!
In your code you write:
Code:
ImageTTFText ($im, $size, 0, $posizione, $size+$altezza, $color1, $font1, $string1);
Whats is $string1
Maby you have a mistake in this string?
 
Back
Top