Asperon Posted November 21, 2007 Share Posted November 21, 2007 how do you access fonts for GD use? I know locally you use your windows directory to your fonts folder, but online, how do you access true type fonts? thank you **freetype 2 is enabled, but how do I access it with imagefttext(), how do you call the font? Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 21, 2007 Share Posted November 21, 2007 You put in were ever you want to. I usually put them in there own directory within my image directory. You put the path to the font in your script. If you are using imagettftext() you would put the path in there. Quote Link to comment Share on other sites More sharing options...
Asperon Posted November 21, 2007 Author Share Posted November 21, 2007 do I copy the font from my fonts folder on in my C drive and put them there? for the imagettftext() or if freetype is enabled, is there already set path to call the fonts. and is there a command where I can see what fonts freetype has avail? Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 21, 2007 Share Posted November 21, 2007 I copy them from my drive to my server to be use by php. Quote Link to comment Share on other sites More sharing options...
Asperon Posted November 21, 2007 Author Share Posted November 21, 2007 I tried putting the font files on my server and using them, but to no avail, maybe my paths are messed up Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 21, 2007 Share Posted November 21, 2007 Here is an example from a captcha I've written, The font is in the same directory as the script <?php //iimagettftext ( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text ) imagettftext($captcha,rand(16,22),$rotangle,($i*$spacing),30,$textcolor,'/arial.ttf',substr($capstr,($i-1),1)); ?> Quote Link to comment Share on other sites More sharing options...
Asperon Posted November 21, 2007 Author Share Posted November 21, 2007 thanks, I got it working, only now, if I save the image via imagepng($im,$loctaion) where $location='images/'.$imageName.'.png'; it won't save the image in the folder, this works on my localserver though Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 21, 2007 Share Posted November 21, 2007 Make sure the directory has the correct permissions Quote Link to comment 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.