GD Fonts (*.gdf fles)

Primary tabs

10 posts / 0 new
Last post
Trevor's picture
Offline
Joined: 16 Aug 2005 - 4:57pm
GD Fonts (*.gdf fles)
0

I am new at font creation, as will be apparent by this post, and was wondering how to go about making bitmap fonts. Allow me to give you a bit of context... I am working with php dynamic imaging, specifically the GD Library. I want to create custom bitmap fonts in order to load with the imageloadfont() function. It may help you answer my question if you take a look at the following page:

http://www.widgnet.com/gdf_fonts/

For a small library of these fonts to play with or at least take a look at in order to help answer my questiong, please take a look at the following page:

http://www.widgnet.com/gdf_fonts/fonts.html

Apparently the creator of this site was able to convert TTF fonts into GDF fonts fairly simply, but he does not explain how, or perhaps I am overlooking a key part of the site.

Essentially, I want to be able to create a small bitmap (maybe 8 by 13 px or something similar, that's not the important part...) for each letter/symbol and compile these bitmaps into a font file. This font file then has the following information:

byte 0-3 (int) number of characters in the font
byte 4-7 (int) value of first character in the font (often 32 for space)
byte 8-11 (int) pixel width of each character
byte 12-15 (int) pixel height of each character
byte 16-EOF (char) array with character data, one byte per pixel in each character, for a total of (nchars*width*height) bytes.

And while I may understand what this information is saying, I'm not sure how to go about using it. Any and all help is appreciated. Thank you =)

-Trevor

Trevor's picture
Offline
Joined: 16 Aug 2005 - 4:57pm
0

Hmm... I found a PHP font converter which converts a *.png file into a *.gdf file, but is this the only way to go about creating a *.gdf file?

Mark Simonson's picture
Offline
Joined: 3 Dec 2001 - 11:00am
0

Wow, that's interesting. One of the bitmap fonts that guy did is based on my Anonymous™ TrueType font. I can't decide whether to be annoyed or honored. Hmm.

Howard Yeend's picture
Offline
Joined: 18 Aug 2005 - 6:23am
0

yo, I'm the puremango dude; if you're talking about the example font on the png2gdf app, I can change the font or link to you if you want? sorry if you're annoyed; I know how it feels when your work gets passed off as someone else's and I promise that wasn't the intention here.

Howard Yeend's picture
Offline
Joined: 18 Aug 2005 - 6:23am
0

and to antiaverage, if you know PHP, the font convertor tool goes through the process step by step, alternatively if you're looking for other ways of creating GD fonts, check out philiplb.de's TTF2GDF tool

Mark Simonson's picture
Offline
Joined: 3 Dec 2001 - 11:00am
0

user24--It's okay, but it would be nice if you could credit the source somehow. Anonymous™ is a free font, but not free-as-in-free-beer.

Howard Yeend's picture
Offline
Joined: 18 Aug 2005 - 6:23am
0

mark; actually on further inspection, the font I used was Arial - I couldn't remember because it's been a while since I wrote the app.

When you said One of the bitmap fonts that guy did is based on my Anonymous™ TrueType font, I thought you meant me, but I think you were actually refering to the widgnet URL, not the example PNG on my site.

Ah well, if I had used your font, you can be assured there would now be a link to you. ;-)

Mark Simonson's picture
Offline
Joined: 3 Dec 2001 - 11:00am
0

I was referring to this:

http://www.widgnet.com/gdf_fonts/preview/anonymous.png

Sorry for the confusion.

Snake Plisskin's picture
Offline
Joined: 22 Aug 2005 - 11:58am
0

I've been struggling with GDF fonts lately, too. Apparently, the fonts are architecture-dependent. I need to use them on a Sun Sparc machine, so the tools mentioned earlier in this thread don't really work for me. Is there anywhere I can get step-by-step info on how to create these fonts? Or, is there a tool out there that works for Sparc machines?

Eduardo Omine's picture
Offline
Joined: 18 Jan 2003 - 6:08am
0

This thread is old, but anyway.
Instead of using GDFs, one can also use TrueType fonts with the imagettftext function in PHP+GD.

-- omine.net