tommyboy123x Posted May 30, 2007 Share Posted May 30, 2007 i'm working on a script that will create a font and output a string to the user with that font, however i dont really understand how to do this with a gdf font... i saw a tool similar to what i want, http://www.puremango.co.uk/cm_web_projects_83.php, but i'm kind of a DIY kind of person. so lets say i create a .gdf file out of the png image like this utility, what is this file exactly? it would be more useful if i could make a TTF (true type font), is this even possible? Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/ Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 See imageloadfont example of what i have done is here Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265200 Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 I'll build you a basic GD font pack, i have a basic GD Font Creator Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265204 Share on other sites More sharing options...
tommyboy123x Posted May 30, 2007 Author Share Posted May 30, 2007 i'll be giving the custom made fonts to the users, but does that function basically load the font and output it to the user in an image? its handy to know cause i have always wondreed how to do that but is there any way to convert this to a TTF for the user to download and save to their computer? thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265221 Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 I don't know if you can convert to TTF.. you can convert TTF to GDF, yes it create an image using the fonts maybe imagettftext would be better i have attached 182kb zip which may help [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265236 Share on other sites More sharing options...
tommyboy123x Posted May 30, 2007 Author Share Posted May 30, 2007 so just to make sure here, when i used that program i mentioned above it created a font file which (for the sake of simplicity) only php can interpret really, and create an image to output from. So what exactly is the "format" for creating a gdf font (... or is that like saying PIN Number?) EDIT: just realized a huge flaw in that script for me, its that the users font is made from a handwriting, so the text is almost never completely black, and the background is not always completely white... i know it can be modified pretty easily though so the... "format" for making the fonts is the $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0); opening? then each time you have a character that is black (the 255?), then it copies it to the GDF image... right? Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265253 Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0); is used when creating the GDF from the png (sample font.png) once thats done it creates font.gdf, this can be loaded in as a GD font that is used by imageloadfont.. hope that makes sense! Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265275 Share on other sites More sharing options...
tommyboy123x Posted May 31, 2007 Author Share Posted May 31, 2007 i really appreciate the help, thanks... i finally understood it when i stared at the php.net table for the imageloadfont() for a few minutes i'm blaming the vicodin Quote Link to comment https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/#findComment-265365 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.