RE: [AD] Font loadin: Feature Request

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


Title: RE: [AD] Font loadin: Feature Request

> I think it's pretty strange that the FONT is the only data
> which cannot be loaded directly.

People keep raising this as a 'problem', and I have to say,
I've never understood why.

For one thing, what is 'not direct' about writing:

        FONT *font = load_datafile("font.dat")->dat;

If it really bothers you so much to be doing this with a
datafile, why not just rename font.dat to font.font, and
#define load_datafile() to load_font()?

More seriously, the reason there is no dedicated load_font()
function is that there is no useful font format, either.
Samples and bitmaps already have standard file formats
that are useful for Allegro to support, but there is a lack
of widespread font formats that match the type of bitmap
font Allegro wants to use (sure, you can write loaders
for things like .ttf files, but those are complicated and
belong in addons).

So, you need some sort of conversion process to turn
bitmaps into something that Allegro can use as a font.
There is no point doing this at load time - wherever
possible, it makes more sense to preconvert your data
in an offline tool, so the runtime loader can be very
small and simple. Hence the grabber.

We could invent an "Allegro font" format, but that would
be stupid because it would end up exactly the same as
a datafile, maybe just with a different file header or
something. There's no point doing that when a perfectly
suitable file format and loader code already exists...



--
Shawn



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