Moez Posted September 4, 2014 Share Posted September 4, 2014 putenv('GDFONTPATH=C:\Windows\Fonts') ; $fontname = arial; do{ $fontname-- ; $bbox = imagettfbbox($font_size,0,$fontname, $text); Link to comment https://forums.phpfreaks.com/topic/290846-fontame-file-is-invalid/ Share on other sites More sharing options...
Ch0cu3r Posted September 4, 2014 Share Posted September 4, 2014 What? We no mind reader Link to comment https://forums.phpfreaks.com/topic/290846-fontame-file-is-invalid/#findComment-1489876 Share on other sites More sharing options...
Moez Posted September 4, 2014 Author Share Posted September 4, 2014 in imagettfbbox() function the 3rd parameter is giving error invalid font filename i think my path is ok tthen why will be mistake in $fontname ??? Link to comment https://forums.phpfreaks.com/topic/290846-fontame-file-is-invalid/#findComment-1489877 Share on other sites More sharing options...
Ch0cu3r Posted September 4, 2014 Share Posted September 4, 2014 Try capitalizing the font name and wrap it in quotes. Strings should be wrapped in quotes $fontname = 'Arial'; If it still does not work, then copy the Arial.ttf font from C:\Windows\Fonts and put it in the same folder as your script. Then change $filename = 'Arial'; to $filename = './Artial.ttf'; Also What is this for? $fontname-- ; That does not make sense to me. Link to comment https://forums.phpfreaks.com/topic/290846-fontame-file-is-invalid/#findComment-1489878 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.