Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

[Allegro]Why can't I load this font?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 jdub   Members   

459
Like
0Likes
Like

Posted 02 August 2012 - 03:53 AM

I have this code:
//init allegro
if(!al_init()) {
  fprintf(stderr, "failed to initialize allegro!\n");
  return -1;
}
al_init_font_addon();
if(!al_init_ttf_addon())
{
  return -1;
}
//create the display
this->display = al_create_display(640, 480);
if(!this->display) {
  fprintf(stderr, "failed to create display!\n");
  return -1;
}
if(!al_install_keyboard())
{
  return -1;
}
//init font
this->font = al_load_ttf_font("pirulen.ttf", 72, 0);
if(!this->font)
{
  return -1;
}

for some reason al_load_ttf_font() fails. Tried everything I can think of. pirulen.ttf is in the top directory of my project as well as being in the debug and release folders of the project. Any ideas on what's going on here?
J.W.

#2 Aldacron   GDNet+   

4487
Like
0Likes
Like

Posted 04 August 2012 - 03:14 AM

The first thing you should do is link with a debug version of allegro and look at allegro.log. al_load_ttf_font will print a message there including a FreeType error code when a font fails to load. That will probably point you in the right direction.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.