Brad Fish's Homepage [Home] [glFont] [Mirage] [Articles] [Links] [Finger bfish@cs.byu.edu] [Mail bhf5@email.byu.edu]

glFont [Home] [News] [Download] [Bugs and Comments] [glFont in a Nutshell] [Origin of glFont] [glFont Usage] [glFont API] [glFont FAQ]

glFont

A program by Brad Fish

News

Monday, November 14, 2005

I've just discovered that my old school email account has been shut down. Please use brad.fish@gmail.com and ignore any reference to my old address on my site. I'll hopefully get around to updating all the old mailto: links soon.

Wednesday, July 3, 2002

The glFont executable has now been fixed so that it generates the correct alpha values for the antialiased pixels in the font.  Download and enjoy!

Sunday, June 16, 2002

Seems the bizarre saving bug in glFont 2.0 has been eliminated.  Turns out the size member of the structure used to bring up the File dialog box was incompatible with Windows 98 and below (I wish they would mention that in the documentation).  glFont now correctly determines the version of Windows it runs on and adjusts the size of that structure as needed.  I've been told it works great now, although I don't have a 98 or ME system to test it on.

In other news, Wednesday is my birthday and I'm heading back to Las Vegas on Tuesday to be with my parents and sisters.  Should be a fun vacation.  Also, Mirage is still moving forward.  Stay tuned!

Tuesday, May 21, 2002

(Later today) OK, I've uploaded a new ZIP for glFont 2.0. It contains the MSVC 7.0 runtime DLLs as well as GidPlus.dll. That should be everything you need to run it. Sorry about the size of the file...it's now nearly 2 MB, just because of the dumb DLLs. Oh well. Enjoy!

Ah...the joys of releasing software. I was just notified that the glFont executable needs the MSVC 7.0 runtime, which I hadn't even thought of. I'll try and either recompile it with Visual C++ 6.0 or else include the runtime in the ZIP. If someone has already gone and found the runtime, I would really appreciate it if they let me know where to download it :-)

Monday, May 20, 2002

glFont 2.0 released!  A more substantial update is forthcoming, but for now you can read the documentation included in the release here.  You can also head to the download page to download it.

Saturday, May 11, 2002

Henri Kyrki has recently ported the glFont API to C++.  He really did a fantastic job, and any interested in the port can now download it from the download page.

Saturday, December 1, 2001

Daniel Klepel has recently contributed a Delphi port of the glFont API for those of you interested.  Check it out!

Friday, November 23, 2001

I've posted the minimal code for a basic program that uses glFont for those who aren't sure they know how to use it.  You can reach it on the FAQ.

Wednesday, November 7, 2001

glFont featured in article on http://www.opengl.org!  Go to Survey of OpenGL font technology to check it out.

Friday, November 2, 2001

Finally updated the glFont FAQ.

Wednesday, October 31, 2001

Now that my old site has been redirected to the new one, I've finally got around to updating this page.  As many of you know, I was out of the country for two years and wasn't able to work on glFont.  It's been over two years since I released it.  It still rocks!  I hope that people find the new site helpful.  The FAQ will be updated as well, including the solution to the "how do I calculate widths and heights in pixels?" question that is asked so often.

News From Over Two Years Ago...

I have recently posted a glFont FAQ.  Please consult it before mailing me with a problem, as it will most likely answer some or all of your questions. Thanks!

Download

Please head here to read the license agreement and download glFont.

Bugs and Comments

If you've found any bugs in the program or the source, please let me know. Comments are also encouraged and welcomed.

glFont in a Nutshell

glFont is a Win32 program that creates a texture containing a range of characters in a specified font, and automatically generates texture coordinates for use in OpenGL applications that need to display text.  The font type is not limited to monospaced fonts; each character is displayed with correct spacing and size.  Text is rendered by texture mapping specific characters onto OpenGL quads.  It is quite possible and easy to modify the color, size, position of the text quads using standard OpenGL functions, as you can see from the screenshot.  It is also quite possible to load as many different fonts as you wish, and use them whenever you please.  This can also be seen in the screenshot.

OpenGL program using glFont with a 3Dfx Voodoo
NOTE:  This screenshot was taken two years ago.

Although glFont is a Windows application, the .glf files it produces do not contain any OS specific data, and are platform independent.

Origin of glFont

While trying to figure out how to display text in an OpenGL program (without GLUT or anything), I came across an article by Mark Kilgard entitled "A Simple OpenGL-based API for Texture Mapped Text" (it appears that the link I used to have to this article is broken).  The idea was to create a texture that contains the font's glyphs and then to display the glyphs as quads.  The tool available was compiled for SGI machines, so it wasn't much use to me.  I thought it might be nice to be able to convert Windows fonts for use in OpenGL, so glFont was born.

glFont Usage

The first thing you will probably want to do is choose the font that will become your glFont.  You can change the font from the dialog accessible through the menu command glFont->Choose Font...  The font dialog is a standard Windows font dialog, and should be familiar.  You can choose the font name, style, size, etc.  If you do not choose a font, a default font will be used.  After choosing your font, glFont needs two things from you: the size of the texture to be generated, as well as the ASCII codes for the two characters that define the interval of characters to draw on the texture.  These properties are can be changed in the Options dialog box accessible through the glfont->Options menu command within the application.  Here is a picture of the Options dialog:

The texture created will have the width and height specified here (default: 128x128).  The little note is mostly a reminder to myself; no checking is actually done to ensure that the dimensions are powers of 2.  If you're wondering why the texture size is limited to 256x256, it's because my efforts are directed primarily towards 3Dfx graphics cards (NOTE: I wrote this over 2 years ago.  Now I'm primarily directed towards developed on my GeForce).  The texture created will contain characters beginning at the start of the character interval up to and including the last character in the interval (default: 32-127).  The interval is specified using ASCII character codes 0 through 255.  Once you're through picking your font and setting up the options for your glFont, you need to actually create the glFont by accessing the menu command glFont->Generate glFont.  You should get something similar to this, depending on your chosen font and options:

Then you simply save your glFont (File->Save) as whatever you please.  You must specify the .glf extension, which identifies the file as a glFont, yourself (a little annoying; fix coming later).

glFont API

The source shouldn't be too hard to follow.  I wanted it simple and easy to use, and I think you'll find that it is just that.  After you download glFont, you'll notice that the API files have a .cpp extension.  The source is actually plain C, and does not contain any C++ code.  If you rename the file with a .c extension you should be able to compile it with a normal C compiler just fine.

 

Last updated: 07/03/2002 07:47:59 PM

glFont [Home] [News] [Download] [Bugs and Comments] [glFont in a Nutshell] [Origin of glFont] [glFont Usage] [glFont API] [glFont FAQ]

Brad Fish's Homepage [Home] [glFont] [Mirage] [Articles] [Links] [Finger bfish@cs.byu.edu] [Mail bhf5@email.byu.edu]