Help with imagecreatefrompng

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
jrp
Forum Newbie
Posts: 3
Joined: Fri Aug 09, 2002 1:24 pm

Help with imagecreatefrompng

Post by jrp »

I am trying to learn php. Was doing just find until I tried to use imagecreatefrompng.

Specs: Running on W2K with 256k memory. Apache/PHP/mySQL
Code:
$fontfile="http://nest/public/kazaam/Arial.ttf";

do
{
$font_size--;
$bbox=imagettfbbox ($font_size, 0, $fontfile, $button_text);

I get the following error on the last line of code.

Warning: Could not find/open font in c:\phpdev\www\public\kazaam\make_button.php on line 32
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Try changing

Code: Select all

$fontfile = 'http://nest/public/kazaam/Arial.ttf';
to

Code: Select all

$fontfile = 'Arial.ttf';
and make sure you have got a copy of Arial.ttf in your kazaam folder.

Mac
jrp
Forum Newbie
Posts: 3
Joined: Fri Aug 09, 2002 1:24 pm

Made the change you suggested; with the same results.

Post by jrp »

:( change make. line now reads

$fontfile = "arial.ttf";

Still get the same results[/url]
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Is Arial.ttf in the kazaam folder?

Mac
jrp
Forum Newbie
Posts: 3
Joined: Fri Aug 09, 2002 1:24 pm

Post by jrp »

Yes. I have even tried moving it to another subdirectory, name fonts.

I have tried every combination I can think of. Even looked at some "Classes" to see if I had missed something. As a Newbie I can't say this is the first instruction I have had problems with, however it is the first that for the life of me, I can't make work.
Post Reply