I basically have the same problem as this guy,
http://www.allegro.cc/forums/thread/606505
except that I am trying to load a .ttf instead.
My code is very similar to that in the thread.
I don't think the thread I am refering to was ever solved, or I cannot see the solution.
Bitmaps load correctly using
something = al_load_bitmap("something.bmp");
but in
ALLEGRO_FONT * technoid_font = NULL;
...
technoid_font = al_load_font("technoid.ttf",60,0);
technoid_font stays NULL.
The files do exist, I know the paths are correct because the bitmap was properly loaded from in the .zip file. I just don't know what I am doing wrong with the font file. It loaded properly from a normal folder before I started using physfs. Thanks!
You're using the wrong function to load a ttf aren't you? It's al_load_ttf_font.
Oooops, my bad. I was not copying and pasting. But I am actually using al_load_ttf_font()
It works fine if I comment out all the physfs stuff and just load from in folder, but I want to use physfs because I have hundreds of resource files.
The guy in the other thread said he solved it by
EDIT: Okay, I solved it.
I removed ALL the libraries I was linking and re-added them in and I think I added in libphysfs.a instead of libphysfs.dll.a by accident. not sure about the difference, I assume one is a statically linked lib. =/
I am linking "allegro_physfs-5.0.0-RC4-mt.dll", which I assume is the correct file?
Edit: I changed to technoid_font_small = al_load_ttf_font("TECHNOIDS.ttf",30,0); and it works. Is it that I cannot load the same file twice? Thanks though.
I don't really know A5, but does al_filename_exists return true?
[edit]ah, well scrap my reply I never saw your update.
Edit: I changed to technoid_font_small = al_load_ttf_font("TECHNOIDS.ttf",30,0); and it works. Is it that I cannot load the same file twice? Thanks though.
Maybe 60 just isn't supported for that font? I don't know how Allegro handles sizes that aren't in the font.
Maybe 60 just isn't supported for that font? I don't know how Allegro handles sizes that aren't in the font.
TTF fonts are drawn using math functions, they don't really have a minimum or maximum size. I learned this a couple few months ago. Time flies when you're having fun!
http://www.allegro.cc/forums/thread/604975/881025
OTOH, I hung the entire box fiddling with an insanely huge font (don't remember the size) and after I rebooted the log files said there had been a crash in the video driver.
technoid_font = al_load_font("technoid.ttf",60,0);
...
Edit: I changed to technoid_font_small = al_load_ttf_font("TECHNOIDS.ttf",30,0); and it works. Is it that I cannot load the same file twice? Thanks though.
The two calls are different - one has an a 's' and one doesn't, so it was the file name giving you problems, not the font size.
He's saying that if he tries to load the same font file twice with different sizes, it fails. If he creates two copies of the font within the same zip file with different names, then he can load them both.
If that is really happening, then it sounds like a bug with Allegro. It should be easy for somebody to reproduce.