Re: [AD] Adding save/load font functions

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


Martijn Versteegh wrote:

[snip]

I'm the writer of such an add-on (see http://home.hccnet.nl/m.versteegh).
And I assure you there is no need for such a thing.

Please do a mailing list search on font loading and see for yourself
what the past discussions on this issue were.


I'd love to, but [AD] isn't archived.


It concludes to something like:
 -there is no such thing as an allegro font format, just datafile, so use that.
 -add ons need to define their own way of loading a font, and there is no
 profit in looping that through allegro.


Actually, there is, but only if add-ons use the FONT* format provided by Allegro in the first place. The idea was that, yes, each add-on could define it's own loading and saving functions, but then, why not have those in Allegro? As for bloat, well you said it yourself, it'd only be a few extra lines :p


 The only way to make differnt types of fonts load differently would be
 to plug a loading function in the vtable, but that is
 of no use if you want to do FONT *f = al_load_font(filename); because
 then you don't have the vtable entry yet in al_load_font.


Not really.

int install_major_addon_package() {
  al_register_font_format(&vtable);
}


FONT *load_font(char *filename) {
  while (registered) {
    if (registered->is_our_font(filename))
       return registered->load(filename);
     registered = registered->next;
  }
}

Saving fonts is even easier, since the vtable is already there.


[snip]

 Would you please consider to only suggest fixes for problems you
 have actually encountered.


Well, this is problem I have encountered (see previous post), otherwise I wouldn't have suggested it.


 Sorry if I seem a bit harsh, but this is about the 1000th time
 this subject has come up the last year.


I only remember being said three times (including this one). Or perhaps, these were just the times when I was paying attention :) In any case, the AD list should be archivable, so at least when these things come up, you can point me to some past discussion about it :P


--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



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