imisspla07 Posted May 21, 2009 Share Posted May 21, 2009 I have been scouring the web for a way to allow a user to write something in a box, pick a font, and show what was written in that specific font. It seems that php is the way to do it, but I can't seem to figure it out. I know javascript and html ok, but know nothing about php and was wondering if anyone could help me without me having to go to B&N and buy an $80, 600 page book on php. Here's a site that does what I'm attempting to do. http://www.1001fonts.com/font_details.html?font_id=3101 My wife makes handmade gifts and monograms them and I wanted people to be able to see what they want monogrammed in the font they choose. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/159154-custom-font-using-php/ Share on other sites More sharing options...
radi8 Posted May 21, 2009 Share Posted May 21, 2009 This seems simple enough as long as the fonts are available on the site. Put the available fonts in a drop down list or something and then do something like: echo "<font face=".$_POST['fontval'].">Text</font> Quote Link to comment https://forums.phpfreaks.com/topic/159154-custom-font-using-php/#findComment-839338 Share on other sites More sharing options...
DarkSuperHero Posted May 21, 2009 Share Posted May 21, 2009 It would be a tad bit more complicated that that, since not all font's are embedable, so you would have to result to using GD with php to generate an image with the specified word...its how the site you specified works.... You would use a process very similar to creating a captcha... check this tutorial out to start... http://www.phpfreaks.com/tutorial/php-add-text-to-image also using functions like this.. http://us.php.net/manual/en/function.imagefttext.php Quote Link to comment https://forums.phpfreaks.com/topic/159154-custom-font-using-php/#findComment-839367 Share on other sites More sharing options...
Adam Posted May 21, 2009 Share Posted May 21, 2009 Actually to do that the user would need to have the font installed on their computer, radi8. You'd need to look into generating the image dynamically with PHP. Perhaps take a look at... http://uk3.php.net/imageloadfont Quote Link to comment https://forums.phpfreaks.com/topic/159154-custom-font-using-php/#findComment-839371 Share on other sites More sharing options...
radi8 Posted May 21, 2009 Share Posted May 21, 2009 Well, live and learn my friends. Quote Link to comment https://forums.phpfreaks.com/topic/159154-custom-font-using-php/#findComment-839382 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.