The original AllegroFont 2.0.9 is broken, making programs crash. This modification solves the problem.
Updated: 2012-02-17. E-mail: alemartf (at) gmail.com
Linux user? This simplified guide has been taken from AGS:
wget http://opensnc.sourceforge.net/alfont/AlFont209.rar unrar x AlFont209.rar cd alfont/ wget http://opensnc.sourceforge.net/alfont/alfont-2.0.9-linux.patch patch -p1 < alfont-2.0.9-linux.patch gcc -fPIC -DPIC -O2 -m32 -Iinclude `freetype-config --cflags` -o src/alfont.o -c src/alfont.c gcc -O2 -m32 -shared -Wl,-soname,libalfont.so.2 -o libalfont.so.2.0.9 src/alfont.o `freetype-config --libs` `allegro-config --libs |sed 's/-lalleg_unsharable//'` sudo install -m 755 libalfont.so.2.0.9 /usr/lib/ sudo install -m 644 include/alfont*.h /usr/include/ sudo ln -s libalfont.so.2.0.9 /usr/lib/libalfont.so.2.0 sudo ln -s libalfont.so.2.0.9 /usr/lib/libalfont.so.2 sudo ln -s libalfont.so.2.0.9 /usr/lib/libalfont.so cd ..
$ diff alfont.c alfont.c.1 0a1,18 > /* > * Modified Alfont 2.0.9 > * > * The original AllegroFont v2.0.9 has a few problems. > * This modification solves them. > * > * Modification by: Alexandre Martins (thanks to http://allegro.cc forums) > * Modification date: 2010-10-30 > * > * Original Alfont website: http://chernsha.sitesled.com/ > * AllegroFont (c) 2001, 2002 Javier Gonzalez > * Enhanced by Chernsha since 2004 year > */ > > #if defined(__GNUC__) && !defined(__MINGW32__) > #define _msize malloc_usable_size > #endif > 471c489 < font->language=""; /* Initial Language */ --- > font->language=NULL; /* Initial Language */ 551c569 < font->language=""; /* Initial Language */ --- > font->language=NULL; /* Initial Language */ 4831c4849 < f->language=(char *)malloc(strlen(language)*sizeof(char)); --- > f->language=(char *)malloc((strlen(language)+1)*sizeof(char));