Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 Generate fonts with an alpha channel

closed
nobody
None
5
2001-12-10
2001-11-08
Damian Yerrick
No

Would it be hard to simplify font rendering by creating
font textures with an alpha channel?

I can see this done in at least two ways:
* Anti-aliased font: Use a texture consisting only of
alpha pixels (GL_ALPHA) based on the font's luma.
(I'm thinking of ttf2pcx's output here.)
* Color font: use 5551 format and set the alpha of all
hot-pink pixels to 0.
* Hybrids using 4444 or 8888.

This would make blending much easier and make it
unnecessary to draw text twice when rendering it
in a particular color.

Discussion

  • Logged In: YES
    user_id=41801

    The code for GL_RGBA8 fonts is already there, but commented out (it doesn't work properly). One day, I'll have to get around and fix it. I'm affraid I don't have the time right now.

     
  • Logged In: YES
    user_id=41801

    gfoot committed a patch on CVS in that regards. The feature is in priliminary stages, so things may change a little in the next few versions.

     
  • George Foot
    George Foot
    2001-12-10

    Logged In: YES
    user_id=22620

    This should be done, please resubmit the request if not.
    See the new exalpfnt example program for how it's done --
    basically, if you set the texture mode to GL_ALPHA4 or
    GL_ALPHA8 before creating the font, it will process it as
    required to generate an alpha texture. I tested it with
    the demo game font (which is what exalpfnt uses). Shout if
    it doesn't work -- on the mailing list if possible.

     
  • George Foot
    George Foot
    2001-12-10

    • status: open --> closed