Pages

Saturday, January 15, 2011

TrueType fonts in Allegro 5 and Mac OS X

I tried the font tutorial, but couldn't run it due to a failed assertion. Despite linking against liballegro_font.dylib and liballegro_ttf.dylib with the linker flags -lallegro_font and -lallegro_ttf, and subsequent success in compilation, the executable immediately quits with an "Abort trap": 





While the tutorial uses a straight font name, on Mac OS X the font path must be fully specified. So if you want to use Arial, the string should be "/Library/Fonts/Arial.ttf". 






A lot prettier fonts than the default in Allegro 4.x. :)

No comments:

Post a Comment