Re: [AD] Allegro 4.2 planning

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On sáb, oct 16, 2004 at 10:07:09 +0200, Elias Pschernig wrote:
> On Sat, 2004-10-16 at 21:30 +0200, Evert Glebbeek wrote:
> > while back with him a way to directly load a font from an Allegro datafile 
> > (ie, a load_font() function). While I think a generic font loading 
> > function would be too much, one that loads a (well defined) font from a 
> > datafile could be useful to have, mainly for new users who don't know how 
> > to use datafiles yet.
> 
> You mean, something like:
> 
> FONT *load_font (char const *filename)
> {
>     DATAFILE *dat = load_datafile (filename);
>     FONT *f = dat[0].dat;
>     dat[0].dat = NULL; /* Hack so the next line works :P */
>     unload_datafile (dat);
>     return f:
> }
> 
> Well, I guess it would fit into the API.

Why not load a font from a bitmap file?  Or what about a routine to
convert a bitmap to a font:

FONT *bitmap_to_font (BITMAP *bmp) { ... }
FONT *load_font_from_datafile (const char *filename) { ... }
FONT *load_font_from_bitmap (const char *filename)
{
  PALETTE pal;
  BITMAP *bmp = load_bitmap (filename, pal);
  FONT *f = bitmap_to_font (bmp);
  destroy_bitmap (bmp);
  return f;
}

-- 
http://www.davidcapello.com.ar





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/