|
|
| bitmap font (using ttf2pcx) using alpha channel |
|
Eviral Derf
Member #4,722
June 2004
|
Hello, Is there a way to draw bitmap font (using ttf2pcx) using alpha channel ? Thanks Eviral |
|
Steve Terry
Member #1,989
March 2002
|
The allergo font and text routines are very flexible, so yes you could rewrite your vtables to output alpha channel fonts, however you would have to write your own routines to piggy back on top of the existing ones for backwards compatibility, this means you will (I think) have to write a loader (I'm not sure if PCX stores additional information that TGA may not support). You will also have to override the vtables (this isn't as hard as it seems). Basically make font->data point to your data containing all the loaded alpha glyphs and font->vtable point to your custom vtable for rendering these glyphs, this can all be done in a load_alpha_font function or whatever you wish to call it. If you want any more assistance you can either poke around font.c in the allergro source directory for clues (I think aintern.c/.h also has a few clues on how to do this as well). Hope this helps. ___________________________________ |
|
Gnatinator
Member #2,330
May 2002
|
If you are using OpenGL/AllegroGL you can use my TGA font lib. (Attached) If not, you could create your own tga font blitter. My code should be simple enough to give you an idea of what to do.
|
|
Kirr
Member #5,060
September 2004
|
If you are making fonts with ttf2pcx, you might try using using ttf font directly in your program. You can get alpha-transparent glyphs with my font lib, like in this example. -- |
|
|