|
al_load_font with PhysFS |
Steve Silva
Member #16,936
January 2019
|
In my current project, im using Allegro5 and PhysFS, and so, im calling al_set_physfs_file_interface() in order to make all subsequent calls to al_fopen() on the calling thread to be handled by PHYSFS_open(). Well at this point, everything is working fine, I can load bitmaps from a zip file, i can even load samples from a zip file... BUT... the ONLY THING thats not working is loading fonts... After calling al_set_physfs_file_interface(), al_load_font() fails no matter if you try to load the font file from a zip file or even from the disk... Any clues on how to solve it? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
https://liballeg.org/a5docs/trunk/fshook.html#al_set_standard_fs_interface EDIT There was an old bug in zlib that was fixed when 3.0.0 came out. You may have caught it. It would cause ttf fonts to fail to load from inside an archive. Solution was to upgrade. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
allegro 5.0.10 mingw 4.7.0 got from https://www.allegro.cc/files/ OS: Windows 10 Pro BTW: Heres an example code where you can test what im saying: #include <D:\CodeBlocks\MinGW\include\physfs\physfs.h> int main() { |
dthompson
Member #5,749
April 2005
|
Can you load bitmap fonts? Edit: probably irrelevant now that I've seen your code. If you're using PhysFS, you might have to use al_load_ttf_font_f instead: ALLEGRO_FILE* f = al_fopen("Arial.ttf", "r"); ALLEGRO_FONT* arial = al_load_ttf_font_f(f, "Arial.ttf", 12, NULL);
______________________________________________________ |
Steve Silva
Member #16,936
January 2019
|
TY verymuch for the fast and friendly help, i really apreciated it, since ppl from coding forums are used to be rude with new users... BUT yesterday i just tried to download the allegro5 AGAIN, in hope they have a new version... Well, looking for the file contents, dll versions, it seems to be the same version as mine, so I even just not tested anything after it... BUT for now, when I was trying to make a better code to show you about the bugs, the font just loaded fine even using the PhysFS and al_set_physfs_file_interface()... Maybe they just fixed it but not changed the version? IDK... I just know that its working fine for now, just using al_load_ttf_font() instead of al_load_ttf_font_f() as you said to do... Anyways, ty again for the help =)))) |
Edgar Reynaldo
Major Reynaldo
May 2007
|
With binaries that old, zlib 3 hadn't even come out yet. :/ Please do yourself a favor and download either my binaries or SiegeLords (if you prefer MSYS2). Find them here : https://www.allegro.cc/forums/thread/617424 And links to SiegeLord's here : http://members.allegro.cc/EdgarReynaldo/BuildA5.html#official Please don't download binaries from allegro.cc files page unless you know exactly what you are doing. Those files are 5 years old. The font bug not loading from an archive was fixed with versions of zlib greater than 3. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Ty mate, i'll check it out later =) |
Doctor Cop
Member #16,833
April 2018
|
Edgar : I have observed that most of the new comers to Allegro 5 use 5.0.10 and this was the version I used when I started. Its may be because the two famous YouTube channels which teach allegro 5 are using 5.0.10. Prior to Allegro I didn't know that it was possible to do so much in C/C++, it was a common misconception among freshers that it's just a terminal oriented language and when I told my friends that it's possible to do much more with Allegro 5 they were overjoyed and started learning. We all started with 5.0.10 because of video tutorials, and they are still using 5.0.10 because it works just fine and there are no video tutorials teaching you how actually this static and dynamic linking works. If someone make a post or article on allegro.cc on how to configure newer versions of Allegro with how to link it statically and dynamically then it will be very good. When I was a total beginner I was unable to link the new version to my project so I used 5.0.10. It will be really nice of you if you can do it. I don't know how to post an article on allegro.cc so...
|
dthompson
Member #5,749
April 2005
|
I think it's probably because this page lists it as the latest version. ______________________________________________________ |
Doctor Cop
Member #16,833
April 2018
|
sthompson : hmm, I think whether someone goes to allegro.cc page or YouTube the result is going to be same. the person is led to believe that 5.0.10 is the latest version. I think those YouTube channels also thought that it's latest version and they used it in their channels. I will ask my friend to make a tutorial on installation of Allegro 5.2.4 on Code Blocks. He has a YouTube channel he posts videos on.
|
dthompson
Member #5,749
April 2005
|
Yes please - anything new would be good ______________________________________________________ |
Doctor Cop
Member #16,833
April 2018
|
|
GullRaDriel
Member #3,861
September 2003
|
Read The Fucking Manual. "Code is like shit - it only smells if it is not yours" |
Doctor Cop
Member #16,833
April 2018
|
then why the '?' sign at the end of "rtfm" ?
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Read The Fine Manual... The information is all out there, just no one takes the time to read it. :/ Granted, most people who start using allegro are complete newbs who don't know how to compile or link a program much less a library. allegro.cc is not liballeg.org nor is it the wiki. All the outdated content gets a little old sometimes. So when I say rtfm? I'm asking a question. Have you read the manual? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
GullRaDriel
Member #3,861
September 2003
|
Edgar is such a good soul. "Code is like shit - it only smells if it is not yours" |
|