Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/53645-solved-gdf-clarification/
Share on other sites

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

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?

$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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.