[SOLVED] - imagettftext not displaying on Linux Server

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
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

[SOLVED] - imagettftext not displaying on Linux Server

Post by anjanesh »

I have imagettftext working on my PC with Win XP, Apache, PHP 5.0.3 but its not working on my Linux server PHP 4.3.10, GD version : 2.0 or higher and FreeType Support Enabled.

Code: Select all

$Font_File   = "../fonts/LSANS.TTF";
@imagettftext($Image, $Size, $Angle, $x, $y,$Colour,$Font_File, $Char);
Image does not get displayed.

Anyone knows why it doesnt in Linux ?

I tried with comic.ttf but no change.
Thanks
Last edited by anjanesh on Tue May 31, 2005 5:06 am, edited 2 times in total.
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post by wwwapu »

Are you sure the font name is LSANS.TTF and not Lsans.TTF?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Yes - I checked upper and lower cases - comic.ttf is in lower case.

<b>Warning</b>: imagettftext(): Could not find/open font in <b>/xxx/xxx.php</b> on line <b>nn</b><br />

Tried even giving full path name - still error. Yet if I put the full pathname in the browser's url, it'll download it.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Relative path problem.
Worked when I gave $Font_File = "fonts/LSANS.TTF";
the script that had this line was included in a script in the upper directory.

Yet all this time this was working in Windows !
Post Reply