Wes1890 Posted October 18, 2007 Share Posted October 18, 2007 I'm messin around with GD scripts, just bored off my ass, and I was wondering... Is there a way to load truetype fonts (.ttf) into PHP GD? I'm tired of the original font, and using GDF fonts make the font really look like crap... Does anyone have an suggestions on what I could to? I'm wanting fonts like "impact", "arial", "dolphin" etc.. also bold, italic etc. and possibly different colors.. How would i do this? Ive searched far and wide Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/ Share on other sites More sharing options...
cooldude832 Posted October 18, 2007 Share Posted October 18, 2007 gotta upload em to your server and then reference them accordingly Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372125 Share on other sites More sharing options...
Wes1890 Posted October 18, 2007 Author Share Posted October 18, 2007 ^ Yeah.. i wish it was that easy. But its not I got an error: Cannot modify header information.... So I moved the header() to the top of the file and got this error: The image “http://...my_image.png” cannot be displayed, because it contains errors. But it does work if I use a crappy looking gdf font... so any more ideas? Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372272 Share on other sites More sharing options...
Wes1890 Posted October 18, 2007 Author Share Posted October 18, 2007 any clue there mate? Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372426 Share on other sites More sharing options...
kenrbnsn Posted October 18, 2007 Share Posted October 18, 2007 Code that's causing the problem? We're not mind readers. Ken Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372451 Share on other sites More sharing options...
atlanta Posted October 18, 2007 Share Posted October 18, 2007 Refer to this thread to use your load your own font http://us2.php.net/manual/en/function.imageloadfont.php Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372467 Share on other sites More sharing options...
Wes1890 Posted October 18, 2007 Author Share Posted October 18, 2007 Code that's causing the problem? We're not mind readers. Ken No need to get "smart".. there is no code to show because I'm ASKING how I can load TrueType Fonts. Refer to this thread to use your load your own font http://us2.php.net/manual/en/function.imageloadfont.php I've looked at that page thousands of times.. but since you posted it, I read it again... I searched the page for "truetype" and found out that PHP has a built in function imagettftext() that loads ttf font files... how sweet is that.. Thanks atlanta Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372755 Share on other sites More sharing options...
rlindauer Posted October 18, 2007 Share Posted October 18, 2007 No need to get "smart".. there is no code to show because I'm ASKING how I can load TrueType Fonts. Well, you mentioned you got some errors, which implies you have some code... Quote Link to comment https://forums.phpfreaks.com/topic/73751-solved-fonts-and-php/#findComment-372772 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.