Hi,
I'm desperately trying to load a .TTF font in Allegro, but every font I tried to load led to a crash! I even tried to a load a font taken from a previous project made with a previous version of Allegro 5, with no luck.
I don't understand what's going on. Can you please help me?
Here's the code:
Can you link a copy of your font so we can try it on our machines? Also, does your display create? Check to see if it's NULL.
I tried the font from http://www.fonts2u.com/pokemon-gb.font and it worked fine, but I don't know if its the same font as you have.
The display is created correctly, as the program crashes after entering this screen mode.
Here are three fonts I tried to load. The Pokémon GB font comes from the same site.
Just in case: on which OS did you try my piece of code?
I'm using DevCPP and Windows 10.
Have you checked your current working directory? DevCPP may be running your program from a different directory than you expect.
Every other thing I load into memory loads fine as I'm always working with relative paths.
I successfully loaded and displayed each of your three fonts on my computer running Windows 10. I used my MinGW 5.3.0-2 binaries of Allegro 5.2.1.1 to compile them.
First, check your return values.
Second, make sure your binaries are compatible with your compiler.
Third, make sure you're using the correct dlls if linking dynamically.
Fourth, link to the debug version of allegro and see if any ASSERTS fail or if allegro.log has any clues as to why it is failing.
{"name":"610556","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/f\/df03973c42d5cc2e66d93ff87db4d196.png","w":802,"h":633,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/f\/df03973c42d5cc2e66d93ff87db4d196"}