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); Quote 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 Quote 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 ??? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/290846-fontame-file-is-invalid/#findComment-1489878 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.