# GL fonts

**URL:** <https://discourse.libsdl.org/t/gl-fonts/6509>\
**Category:** SDL Development\
**Created:** [April 24, 2002, 1:14pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509 "2002-04-24T13:14:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaB\_JacKaL](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@HaB\_JacKaL](https://discourse.libsdl.org/u/HaB_JacKaL)\
**Post date:** [April 24, 2002, 1:14pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/1 "2002-04-24T13:14:00Z")

</div>

blah.

Can someone give me a brief explanation of creating bitmapped fonts for use  
in GL? I have a working version for vanilla SDL, but try as I might, I  
can’t seem to come up with a decent one for GL that isn’t a complete pain to  
use.

The SDL version is just like

font = initFont(srcBitmap, r, g, b, a);  
font.writeLine(x, y, “writing this line”);

I’d _LIKE_ it to be that simple in GL. I know this is solely dependent on  
how much work I want to do behind the scenes…but still. It can’t be as  
ugly as examples I am seeing. The SDL version creates pixel data for each  
letter of the font. Is it possible to use glCopyPixels() to grab individual  
letters in order to do the blit? The red book says to use display lists,  
and swap the list base number when using multiple fonts, but Lord…that  
just seems so ugly to me…

Is there a better way? Or while I’m wishing, should I go ahead and wish for  
a pony, too?

[;

-HaB\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Join the world?s largest e-mail service with MSN Hotmail.  
[http://www.hotmail.com](http://www.hotmail.com)

---

<div class="post-metadata">

**Author:** ![EvilTypeGuy](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@EvilTypeGuy](https://discourse.libsdl.org/u/EvilTypeGuy)\
**Post date:** [April 24, 2002, 1:24pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/2 "2002-04-24T13:24:00Z")

</div>

I use sfont, and it’s usually just that simple in my experience 🙂

-EvilTypeGuyOn Wed, Apr 24, 2002 at 04:13:03PM -0400, HaB JacKaL wrote:

> blah.
> 
> Can someone give me a brief explanation of creating bitmapped fonts for use  
> in GL? I have a working version for vanilla SDL, but try as I might, I  
> can’t seem to come up with a decent one for GL that isn’t a complete pain  
> to use.
> 
> The SDL version is just like
> 
> font = initFont(srcBitmap, r, g, b, a);  
> font.writeLine(x, y, “writing this line”);
> 
> I’d _LIKE_ it to be that simple in GL. I know this is solely dependent on  
> how much work I want to do behind the scenes…but still. It can’t be as  
> ugly as examples I am seeing. The SDL version creates pixel data for each  
> letter of the font. Is it possible to use glCopyPixels() to grab  
> individual letters in order to do the blit? The red book says to use  
> display lists, and swap the list base number when using multiple fonts, but  
> Lord…that just seems so ugly to me…
> 
> Is there a better way? Or while I’m wishing, should I go ahead and wish  
> for a pony, too?
> 
> [;
> 
> -HaB
> 
> * * *
> 
> Join the world?s largest e-mail service with MSN Hotmail.  
> [http://www.hotmail.com](http://www.hotmail.com)
> 
> * * *
> 
> SDL mailing list  
> SDL at [libsdl.org](http://libsdl.org)  
> [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Blake\_Senftner](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blake_senftner/32/170_2.png) [@Blake\_Senftner](https://discourse.libsdl.org/u/Blake_Senftner)\
**Post date:** [April 24, 2002, 2:47pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/3 "2002-04-24T14:47:01Z")

</div>

I’ve been experimenting with Texfont, but I’m having issues with it. The API  
is as easy as you indicate, but I’m finding that it leaves OGL in some funky  
state where I can’t render anything after rendering some text… There is  
also the FNT library from Steven Baker’s Plib, which uses the same .fnt  
files as TexFont. But FNT is LGPL released as a .lib, which seems to tell me  
that I’d have to release my stuff in a relinkable format if I were to use  
it.

I think I’ll have a quick look at that “sfont” that “EvilTypeGuy”  
suggested…

-Blake\> ----- Original Message -----

> From: [feelthel0ve@hotmail.com](mailto:feelthel0ve@hotmail.com) (HaB JacKaL)  
> To:   
> Sent: Wednesday, April 24, 2002 1:13 PM  
> Subject: [SDL] GL fonts
> 
> > blah.
> > 
> > Can someone give me a brief explanation of creating bitmapped fonts for  
> > use  
> > in GL? I have a working version for vanilla SDL, but try as I might, I  
> > can’t seem to come up with a decent one for GL that isn’t a complete pain  
> > to  
> > use.
> > 
> > The SDL version is just like
> > 
> > font = initFont(srcBitmap, r, g, b, a);  
> > font.writeLine(x, y, “writing this line”);
> > 
> > I’d _LIKE_ it to be that simple in GL. I know this is solely dependent on  
> > how much work I want to do behind the scenes…but still. It can’t be as  
> > ugly as examples I am seeing. The SDL version creates pixel data for each  
> > letter of the font. Is it possible to use glCopyPixels() to grab  
> > individual  
> > letters in order to do the blit? The red book says to use display lists,  
> > and swap the list base number when using multiple fonts, but Lord…that  
> > just seems so ugly to me…
> > 
> > Is there a better way? Or while I’m wishing, should I go ahead and wish  
> > for  
> > a pony, too?
> > 
> > [;
> > 
> > -HaB
> > 
> > * * *
> > 
> > Join the world’s largest e-mail service with MSN Hotmail.  
> > [http://www.hotmail.com](http://www.hotmail.com)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![EvilTypeGuy](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@EvilTypeGuy](https://discourse.libsdl.org/u/EvilTypeGuy)\
**Post date:** [April 24, 2002, 3:09pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/4 "2002-04-24T15:09:00Z")

</div>

> I’ve been experimenting with Texfont, but I’m having issues with it. The API  
> is as easy as you indicate, but I’m finding that it leaves OGL in some funky  
> state where I can’t render anything after rendering some text… There is  
> also the FNT library from Steven Baker’s Plib, which uses the same .fnt  
> files as TexFont. But FNT is LGPL released as a .lib, which seems to tell me  
> that I’d have to release my stuff in a relinkable format if I were to use  
> it.

Considering that you’re using SDL, you’d have to do that anyway 😉

> I think I’ll have a quick look at that “sfont” that “EvilTypeGuy”  
> suggested…

[http://www.linux-games.com/sfont/](http://www.linux-games.com/sfont/)

> From the sound of it though, you wouldn’t want to use it as it’s GPL, not  
> LGPL…

> -Blake

-EvilTypeGuyOn Wed, Apr 24, 2002 at 02:50:05PM -0700, Blake Senftner wrote:

---

<div class="post-metadata">

**Author:** ![Blake\_Senftner](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blake_senftner/32/170_2.png) [@Blake\_Senftner](https://discourse.libsdl.org/u/Blake_Senftner)\
**Post date:** [April 24, 2002, 3:10pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/5 "2002-04-24T15:10:01Z")

</div>

Well… “sfont” is not a OGL solution, so I would expect that it will stall  
any OpenGL rendering, killing frame rates. Anyone else know of any OpenGL  
bitmapped font systems?

Looks like fixing TexFont is the solution…

-Blake\> ----- Original Message -----

> From: @Blake_Senftner (Blake Senftner)  
> To:   
> Sent: Wednesday, April 24, 2002 2:50 PM  
> Subject: Re: [SDL] GL fonts
> 
> > I’ve been experimenting with Texfont, but I’m having issues with it. The  
> > API  
> > is as easy as you indicate, but I’m finding that it leaves OGL in some  
> > funky  
> > state where I can’t render anything after rendering some text… There is  
> > also the FNT library from Steven Baker’s Plib, which uses the same .fnt  
> > files as TexFont. But FNT is LGPL released as a .lib, which seems to tell  
> > me  
> > that I’d have to release my stuff in a relinkable format if I were to use  
> > it.
> > 
> > I think I’ll have a quick look at that “sfont” that “EvilTypeGuy”  
> > suggested…
> > 
> > -Blake
> > 
> > ----- Original Message -----  
> > From: “HaB JacKaL”   
> > To:   
> > Sent: Wednesday, April 24, 2002 1:13 PM  
> > Subject: [SDL] GL fonts
> > 
> > > blah.
> > > 
> > > Can someone give me a brief explanation of creating bitmapped fonts for  
> > > use  
> > > in GL? I have a working version for vanilla SDL, but try as I might, I  
> > > can’t seem to come up with a decent one for GL that isn’t a complete  
> > > pain  
> > > to  
> > > use.
> > > 
> > > The SDL version is just like
> > > 
> > > font = initFont(srcBitmap, r, g, b, a);  
> > > font.writeLine(x, y, “writing this line”);
> > > 
> > > I’d _LIKE_ it to be that simple in GL. I know this is solely dependent  
> > > on  
> > > how much work I want to do behind the scenes…but still. It can’t be  
> > > as  
> > > ugly as examples I am seeing. The SDL version creates pixel data for  
> > > each  
> > > letter of the font. Is it possible to use glCopyPixels() to grab  
> > > individual  
> > > letters in order to do the blit? The red book says to use display  
> > > lists,  
> > > and swap the list base number when using multiple fonts, but Lord…that  
> > > just seems so ugly to me…
> > > 
> > > Is there a better way? Or while I’m wishing, should I go ahead and wish  
> > > for  
> > > a pony, too?
> > > 
> > > [;
> > > 
> > > -HaB
> > > 
> > > * * *
> > > 
> > > Join the world’s largest e-mail service with MSN Hotmail.  
> > > [http://www.hotmail.com](http://www.hotmail.com)
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [libsdl.org](http://libsdl.org)  
> > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Blake\_Senftner](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blake_senftner/32/170_2.png) [@Blake\_Senftner](https://discourse.libsdl.org/u/Blake_Senftner)\
**Post date:** [April 24, 2002, 4:05pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/6 "2002-04-24T16:05:01Z")

</div>

Actually, with SDL I just redistribute the SDL ddls.

-Blake\> ----- Original Message -----

> From: [eviltypeguy@qeradiant.com](mailto:eviltypeguy@qeradiant.com) (EvilTypeGuy)  
> To:   
> Sent: Wednesday, April 24, 2002 3:10 PM  
> Subject: Re: [SDL] GL fonts
> 
> > On Wed, Apr 24, 2002 at 02:50:05PM -0700, Blake Senftner wrote:
> > 
> > > I’ve been experimenting with Texfont, but I’m having issues with it. The  
> > > API  
> > > is as easy as you indicate, but I’m finding that it leaves OGL in some  
> > > funky  
> > > state where I can’t render anything after rendering some text… There  
> > > is  
> > > also the FNT library from Steven Baker’s Plib, which uses the same .fnt  
> > > files as TexFont. But FNT is LGPL released as a .lib, which seems to  
> > > tell me  
> > > that I’d have to release my stuff in a relinkable format if I were to  
> > > use  
> > > it.
> > 
> > Considering that you’re using SDL, you’d have to do that anyway 😉
> > 
> > > I think I’ll have a quick look at that “sfont” that “EvilTypeGuy”  
> > > suggested…
> > 
> > [Linux-games.com](http://www.linux-games.com/sfont/)
> > 
> > From the sound of it though, you wouldn’t want to use it as it’s GPL, not  
> > LGPL…
> > 
> > > -Blake
> > 
> > -EvilTypeGuy
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![John\_Lagerquist](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@John\_Lagerquist](https://discourse.libsdl.org/u/John_Lagerquist)\
**Post date:** [April 24, 2002, 4:59pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/7 "2002-04-24T16:59:01Z")

</div>

How about the font library from PLIB? It works great for me in OpenGL.

[http://plib.sourceforge.net/whats\_inside.html](http://plib.sourceforge.net/whats_inside.html)

John\> ----- Original Message -----

> From: [bsenftner@earthlink.net](mailto:bsenftner@earthlink.net) (Blake Senftner)  
> To:   
> Sent: Wednesday, April 24, 2002 6:11 PM  
> Subject: Re: [SDL] GL fonts
> 
> > Well… “sfont” is not a OGL solution, so I would expect that it will  
> > stall  
> > any OpenGL rendering, killing frame rates. Anyone else know of any OpenGL  
> > bitmapped font systems?
> > 
> > Looks like fixing TexFont is the solution…
> > 
> > -Blake
> > 
> > ----- Original Message -----  
> > From: “Blake Senftner”   
> > To:   
> > Sent: Wednesday, April 24, 2002 2:50 PM  
> > Subject: Re: [SDL] GL fonts
> > 
> > > I’ve been experimenting with Texfont, but I’m having issues with it. The  
> > > API  
> > > is as easy as you indicate, but I’m finding that it leaves OGL in some  
> > > funky  
> > > state where I can’t render anything after rendering some text… There  
> > > is  
> > > also the FNT library from Steven Baker’s Plib, which uses the same .fnt  
> > > files as TexFont. But FNT is LGPL released as a .lib, which seems to  
> > > tell  
> > > me  
> > > that I’d have to release my stuff in a relinkable format if I were to  
> > > use  
> > > it.
> > > 
> > > I think I’ll have a quick look at that “sfont” that “EvilTypeGuy”  
> > > suggested…
> > > 
> > > -Blake
> > > 
> > > ----- Original Message -----  
> > > From: “HaB JacKaL”   
> > > To:   
> > > Sent: Wednesday, April 24, 2002 1:13 PM  
> > > Subject: [SDL] GL fonts
> > > 
> > > > blah.
> > > > 
> > > > Can someone give me a brief explanation of creating bitmapped fonts  
> > > > for  
> > > > use  
> > > > in GL? I have a working version for vanilla SDL, but try as I might,  
> > > > I  
> > > > can’t seem to come up with a decent one for GL that isn’t a complete  
> > > > pain  
> > > > to  
> > > > use.
> > > > 
> > > > The SDL version is just like
> > > > 
> > > > font = initFont(srcBitmap, r, g, b, a);  
> > > > font.writeLine(x, y, “writing this line”);
> > > > 
> > > > I’d _LIKE_ it to be that simple in GL. I know this is solely  
> > > > dependent  
> > > > on  
> > > > how much work I want to do behind the scenes…but still. It can’t  
> > > > be  
> > > > as  
> > > > ugly as examples I am seeing. The SDL version creates pixel data for  
> > > > each  
> > > > letter of the font. Is it possible to use glCopyPixels() to grab  
> > > > individual  
> > > > letters in order to do the blit? The red book says to use display  
> > > > lists,  
> > > > and swap the list base number when using multiple fonts, but  
> > > > Lord…that  
> > > > just seems so ugly to me…
> > > > 
> > > > Is there a better way? Or while I’m wishing, should I go ahead and  
> > > > wish  
> > > > for  
> > > > a pony, too?
> > > > 
> > > > [;
> > > > 
> > > > -HaB
> > > > 
> > > > * * *
> > > > 
> > > > Join the world’s largest e-mail service with MSN Hotmail.  
> > > > [http://www.hotmail.com](http://www.hotmail.com)
> > > > 
> > > > * * *
> > > > 
> > > > SDL mailing list  
> > > > SDL at [libsdl.org](http://libsdl.org)  
> > > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [libsdl.org](http://libsdl.org)  
> > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Blake\_Senftner](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blake_senftner/32/170_2.png) [@Blake\_Senftner](https://discourse.libsdl.org/u/Blake_Senftner)\
**Post date:** [April 24, 2002, 5:06pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/8 "2002-04-24T17:06:02Z")

</div>

OK, I was able to get TexFont to work by ignoring the example logic from the author’s web page and just using my noggin to setup the OGL environment how I thought it should be… and it worked.

So, this site has the source files and the documentation:

[http://www.opengl.org/developers/code/mjktips/TexFont/TexFont.html](http://www.opengl.org/developers/code/mjktips/TexFont/TexFont.html)

The license is a “do whatever you want with this- but it is not in the public domain” strange type of license. I guess he just doesn’t want it showing up in someone’s book or technical paper without his permission. But it is free for use in commercial applications.

With the following wrapper logic you should be able to get it working with SDL. Note that if you support resizable windows or a toggle to and from full screen, you have to recall the txfEstablishTexture() routine on the font after the resize/toggle event. You can just call the “InitFont()” wrapper routine that I provide here and it should be cool. One may also want to consider deleting the texture objects and the TexFont structure before the resize/toggle event, since the destruction and recreation of an OpenGL context that occurs with an additional call to SDL\_SetVideoMode() may end up leaving the texture object that is the bitmapped font dangling.

------------------------------------ code starts here -----------------------------------------  
BOOL InitFont( VOID );  
BOOL FontRender( CHAR \*string );  
TexFont \*gCurrTexturedFont = NULL;  
// ------------------------------------------------------------------------------------------------------  
BOOL InitFont( VOID )  
{  
CHAR \*fontStr = “C:\Blake\HGS\txf\times\_medium.txf”;

if (!gCurrTexturedFont)  
{  
gCurrTexturedFont = txfLoadFont( fontStr );  
if (!gCurrTexturedFont)  
{  
fprintf( stderr, “Problem loading %s, %s\n”, fontStr, txfErrorString() );  
return FALSE;  
}  
}

txfEstablishTexture( gCurrTexturedFont, 0, GL\_TRUE );

return TRUE;  
}  
// ------------------------------------------------------------------------------------------------------  
BOOL FontRender( CHAR \*string )  
{  
glEnable(GL\_TEXTURE\_2D);  
glEnable(GL\_BLEND);  
glBlendFunc(GL\_SRC\_ALPHA, GL\_ONE\_MINUS\_SRC\_ALPHA);

INT32 stringLen = strlen( string );  
INT32 width, ascent, descent;  
txfGetStringMetrics( gCurrTexturedFont, string, stringLen, &width, &ascent, &descent);

glPushMatrix();

INT32 x = (INT32)(-width \* 0.5f), y = 0;  
glTranslatef( (float)x, (float)y, 0.0f );

// note that I use a +z is “up” type of coordinate system,  
// therefore I need to rotate by 90 in X before rendering any text…  
glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );

glColor3f( 0.2f, 0.2f, 0.9f );

txfRenderString( gCurrTexturedFont, string, stringLen );

glPopMatrix();

glDisable(GL\_BLEND);  
glDisable(GL\_TEXTURE\_2D);

return TRUE;  
}

------------------------------------ code ends here -----------------------------------------

Slight side note: while looking up the address to the TexFont home page I can across this:

[http://nate.scuzzy.net/programming/gltexfont/gltexfontdoc.html](http://nate.scuzzy.net/programming/gltexfont/gltexfontdoc.html)  
[http://nate.scuzzy.net/programming/gltexfont/](http://nate.scuzzy.net/programming/gltexfont/)

which is another OpenGL font library with a very similar name but different features. It allows meta characters within the string to turn on and off italics and possibly other neato stuff. But since I got TexFont to work, I did not really persue it.

Back on the TexFont topic, this site here:

[http://plib.sourceforge.net/fnt/index.html](http://plib.sourceforge.net/fnt/index.html)

is a GLUT based OpenGL font library by Steve Baker that also reads the same “.fnt” files as TexFont, and that version distributes about a dozen example fonts that you can use with TexFont. So if you use TexFont you may want to grab those also. On the home page for TexFont there is an X based utility that generates new TexFonts, but since I’m developing on Win32 I can’t use it. If anyone working within an X environment does happen to start using the GenTexFont utility, I would appreciate them passing any useful fonts my way.

good luck,  
-Blake

---

<div class="post-metadata">

**Author:** ![Jason\_Hoffoss](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@Jason\_Hoffoss](https://discourse.libsdl.org/u/Jason_Hoffoss)\
**Post date:** [April 24, 2002, 7:10pm UTC](https://discourse.libsdl.org/t/gl-fonts/6509/9 "2002-04-24T19:10:00Z")

</div>

What I do is just put all the characters in one big texture, and then when  
rendering text, select texture coordinates so the correct character covers  
the quad. It’s not to hard, and it works good for me. Do you not want to  
write your own font code to handle it all? If so, I can’t help you there,  
since I always do it myself.\> ----- Original Message -----

> From: [bsenftner@earthlink.net](mailto:bsenftner@earthlink.net) (Blake Senftner)  
> To:   
> Sent: Wednesday, April 24, 2002 6:11 PM  
> Subject: Re: [SDL] GL fonts
> 
> > Well… “sfont” is not a OGL solution, so I would expect that it will  
> > stall  
> > any OpenGL rendering, killing frame rates. Anyone else know of any OpenGL  
> > bitmapped font systems?
> > 
> > Looks like fixing TexFont is the solution…
> > 
> > -Blake
> > 
> > ----- Original Message -----  
> > From: “Blake Senftner”   
> > To:   
> > Sent: Wednesday, April 24, 2002 2:50 PM  
> > Subject: Re: [SDL] GL fonts
> > 
> > > I’ve been experimenting with Texfont, but I’m having issues with it. The  
> > > API  
> > > is as easy as you indicate, but I’m finding that it leaves OGL in some  
> > > funky  
> > > state where I can’t render anything after rendering some text… There  
> > > is  
> > > also the FNT library from Steven Baker’s Plib, which uses the same .fnt  
> > > files as TexFont. But FNT is LGPL released as a .lib, which seems to  
> > > tell  
> > > me  
> > > that I’d have to release my stuff in a relinkable format if I were to  
> > > use  
> > > it.
> > > 
> > > I think I’ll have a quick look at that “sfont” that “EvilTypeGuy”  
> > > suggested…
> > > 
> > > -Blake
> > > 
> > > ----- Original Message -----  
> > > From: “HaB JacKaL”   
> > > To:   
> > > Sent: Wednesday, April 24, 2002 1:13 PM  
> > > Subject: [SDL] GL fonts
> > > 
> > > > blah.
> > > > 
> > > > Can someone give me a brief explanation of creating bitmapped fonts  
> > > > for  
> > > > use  
> > > > in GL? I have a working version for vanilla SDL, but try as I might,  
> > > > I  
> > > > can’t seem to come up with a decent one for GL that isn’t a complete  
> > > > pain  
> > > > to  
> > > > use.
> > > > 
> > > > The SDL version is just like
> > > > 
> > > > font = initFont(srcBitmap, r, g, b, a);  
> > > > font.writeLine(x, y, “writing this line”);
> > > > 
> > > > I’d _LIKE_ it to be that simple in GL. I know this is solely  
> > > > dependent  
> > > > on  
> > > > how much work I want to do behind the scenes…but still. It can’t  
> > > > be  
> > > > as  
> > > > ugly as examples I am seeing. The SDL version creates pixel data for  
> > > > each  
> > > > letter of the font. Is it possible to use glCopyPixels() to grab  
> > > > individual  
> > > > letters in order to do the blit? The red book says to use display  
> > > > lists,  
> > > > and swap the list base number when using multiple fonts, but  
> > > > Lord…that  
> > > > just seems so ugly to me…
> > > > 
> > > > Is there a better way? Or while I’m wishing, should I go ahead and  
> > > > wish  
> > > > for  
> > > > a pony, too?
> > > > 
> > > > [;
> > > > 
> > > > -HaB
> > > > 
> > > > * * *
> > > > 
> > > > Join the world’s largest e-mail service with MSN Hotmail.  
> > > > [http://www.hotmail.com](http://www.hotmail.com)
> > > > 
> > > > * * *
> > > > 
> > > > SDL mailing list  
> > > > SDL at [libsdl.org](http://libsdl.org)  
> > > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [libsdl.org](http://libsdl.org)  
> > > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
