Allegro unable to load font
Bob Keane

I am following the tutorials for allegro 5 and running into a problem. I copied this code from the guide, downloaded the font from the page and copied it to the folder with the executable per the page. When I run the program, I get the error the font could not be loaded. I assumed the download may have been corrupted so I googled and downloaded the font from the web and tried again. Still no luck. I tried using one of the fonts from my distro and it did not work. I checked the forums, and this thread suggests I may have a buggy version of allegro so I removed and reinstalled Allegro through package manager. Still no luck. Any ideas

Edgar Reynaldo

See Current Working Directory.

You have to run the exe from the folder where it is located. CB will run it from a different directory, depending on whether or not you've changed your project structure.

To fix this permanently, and to offer a more flexible solution, you can change the current working directory yourself using allegro 5 :

ALLEGRO_PATH* p = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
al_change_directory(al_path_cstr(p , ALLEGRO_NATIVE_PATH_SEP));
al_destroy_path(p);
p = 0;

Bob Keane

Always something simple. Thanks.

Someone may want to take a look at the tutorial, this is what I get:

{"name":"611896","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/5\/e5ea9d6646c847bb06e84e0f39672f54.png","w":1366,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/5\/e5ea9d6646c847bb06e84e0f39672f54"}611896

Thread #617730. Printed from Allegro.cc