Re: [AD] New font types

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


> If I understand you right, you want to be able to load a normal FONT
> from a datafile, but have a different vtable other than color/mono?

Exactly too :-) But I thought you wanted to package your new font type as a
DAT_FONT within the datafiles. It sounds like it is not the case ?

> I don't really know how to do that, although I suppose we could add ids
> to the relevant vtables,

Each DAT_FONT in a datafile contains one byte that tells Allegro how to set
up its vtable when load_datafile() is called. For the time being:
0->mono_vtable, 1->color_vtable. We could add a registration function for
sub-objects of type DAT_FONT.

> but I was thinking more along the lines of just changing the object type
> in the datafile and registering a custom handler. Which would you prefer?
> (The latter does not require library changes).

The latter obviously needs less work :-) so let's go for it. So, basically,
you would register a handler for a DAT_CUSTOM_FONT type, but tell the user
to cast the object to (FONT *) if you decided to support direct loading of
datafiles. Fine with me.

Now to the dat2s/c side. What I wanted to say by "plugin-ize" dat2c/s is the
following thing: let's try to leverage the plugin support we already have
for the dat utility and the grabber, i.e devise an interface that plugins
could use to register themselves with dat2s/c. This would embrace and extend
(huh, huh... why do I suddenly feel uncomfortable ? ;-) your idea of text
files for constructor functions.

--
Eric Botcazou



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