<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>al_load_font with PhysFS</title>
		<link>http://www.allegro.cc/forums/view/617703</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 25 Jan 2019 01:26:02 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>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?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Silva)</author>
		<pubDate>Sun, 20 Jan 2019 07:15:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="https://liballeg.org/a5docs/trunk/fshook.html#al_set_standard_fs_interface">https://liballeg.org/a5docs/trunk/fshook.html#al_set_standard_fs_interface</a></p><p><b>EDIT</b><br />Please state which versions of allegro, compiler, and OS you are using. If you&#39;re using binaries, where did you get them from?</p><p>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.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 20 Jan 2019 11:07:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>allegro 5.0.10 mingw 4.7.0 got from <a href="https://www.allegro.cc/files/">https://www.allegro.cc/files/</a><br />PhysicsFS 3.0.1 got from <a href="https://icculus.org/physfs/">https://icculus.org/physfs/</a></p><p>OS: Windows 10 Pro<br />Compiler: CodeBlocks 17.12 (GNU GCC Compiler)</p><p>BTW: Heres an example code where you can test what im saying:</p><p>#include &lt;D:\CodeBlocks\MinGW\include\physfs\physfs.h&gt;<br />#include &lt;allegro5/allegro.h&gt;<br />#include &lt;allegro5/allegro_primitives.h&gt;<br />#include &lt;allegro5/allegro_font.h&gt;<br />#include &lt;allegro5/allegro_ttf.h&gt;<br />#include &lt;allegro5/allegro_physfs.h&gt;</p><p>int main() {<br />  PHYSFS_init(0);<br />  PHYSFS_mount(&quot;ADD HERE A PATH FOR A ZIP FILE WHICH MUST CONTAIN THE Arial.ttf font inside&quot;&quot;,0,1);<br />  al_init();<br />  al_init_primitives_addon();<br />  al_init_font_addon();<br />  al_init_ttf_addon();<br />  ALLEGRO_DISPLAY *display=al_create_display(100,50);<br />  ALLEGRO_FONT *font;<br />  if(0) {<br />    //Enable this block for the &quot;not working&quot; version<br />    al_set_physfs_file_interface();<br />    font=al_load_ttf_font(&quot;Arial.ttf&quot;,20,0);<br />  }<br />  else {<br />    font=al_load_ttf_font(&quot;C:\\Windows\\Fonts\\Arial.ttf&quot;,20,0);<br />  }<br />  al_set_target_backbuffer(display);<br />  al_clear_to_color(al_map_rgb(255,255,255));<br />  al_draw_text(font,al_map_rgb(0,0,0),50,25,ALLEGRO_ALIGN_CENTER,&quot;TEXT&quot;);<br />  al_flip_display();<br />  al_rest(2);<br />  return 0;<br />}
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Silva)</author>
		<pubDate>Sun, 20 Jan 2019 17:38:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you load <a href="https://liballeg.org/a5docs/trunk/font.html#al_grab_font_from_bitmap">bitmap fonts</a>?</p><p><b>Edit:</b> probably irrelevant now that I&#39;ve seen your code. If you&#39;re using PhysFS, you might have to use <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_ttf_font_f"><span class="a">al_load_ttf_font_f</span></a></span> instead:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/ALLEGRO_FILE"><span class="a">ALLEGRO_FILE</span></a><span class="k3">*</span> f <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span><span class="s">"Arial.ttf"</span>, <span class="s">"r"</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/ALLEGRO_FONT"><span class="a">ALLEGRO_FONT</span></a><span class="k3">*</span> arial <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_ttf_font_f"><span class="a">al_load_ttf_font_f</span></a><span class="k2">(</span>f, <span class="s">"Arial.ttf"</span>, <span class="n">12</span>, NULL<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Sun, 20 Jan 2019 18:35:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>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 =))))
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Silva)</author>
		<pubDate>Sun, 20 Jan 2019 19:10:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>With binaries that old, zlib 3 hadn&#39;t even come out yet. :/</p><p>Please do yourself a favor and download either my binaries or SiegeLords (if you prefer MSYS2).</p><p>Find them here :</p><p><a href="https://www.allegro.cc/forums/thread/617424">https://www.allegro.cc/forums/thread/617424</a></p><p>And links to SiegeLord&#39;s here :</p><p><a href="http://members.allegro.cc/EdgarReynaldo/BuildA5.html#official">http://members.allegro.cc/EdgarReynaldo/BuildA5.html#official</a></p><p>Please don&#39;t download binaries from allegro.cc files page unless you know <b>exactly</b> what you are doing. Those files are 5 years old. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>The font bug not loading from an archive was fixed with versions of zlib greater than 3.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 20 Jan 2019 22:03:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ty mate, i&#39;ll check it out later =)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Silva)</author>
		<pubDate>Sun, 20 Jan 2019 23:39:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>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.</p><p>Its may be because the two famous YouTube channels which teach allegro 5 are using 5.0.10. Prior to Allegro I didn&#39;t know that it was possible to do so much in C/C++, it was a common misconception among freshers that it&#39;s just a terminal oriented language and when I told my friends that it&#39;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&#39;t know how to post an article on allegro.cc so...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Mon, 21 Jan 2019 15:09:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think it&#39;s probably because <a href="https://www.allegro.cc/files/">this page</a> lists it as the latest version.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Mon, 21 Jan 2019 17:14:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>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.</p><p>I think those YouTube channels also thought that it&#39;s latest version and they used it in their channels.</p><p>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.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Tue, 22 Jan 2019 15:35:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes please - anything new would be good <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Tue, 22 Jan 2019 16:06:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5">https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5</a></p><p><a href="https://wiki.allegro.cc/index.php?title=Getting_Started#Installing_Allegro">https://wiki.allegro.cc/index.php?title=Getting_Started#Installing_Allegro</a></p><p>rtfm?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2019 16:17:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks Edgar for the links.<br />what does</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617703/1040953#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> rtfm? </p></div></div><p> mean?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Thu, 24 Jan 2019 15:59:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Read The <span class="cuss"><span>Fuck</span></span>ing Manual. <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Thu, 24 Jan 2019 16:17:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>then why the &#39;?&#39; sign at the end of &quot;rtfm&quot; ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Thu, 24 Jan 2019 17:38:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Read The Fine Manual...</p><p>The information is all out there, just no one takes the time to read it. :/</p><p>Granted, most people who start using allegro are complete newbs who don&#39;t know how to compile or link a program much less a library.</p><p>allegro.cc is not liballeg.org nor is it the wiki. All the outdated content gets a little old sometimes.</p><p>So when I say rtfm? I&#39;m asking a question. Have you read the manual?<br /> Not you in particular Doctor Cop, you&#39;ve been a very solid learner and I like your attitude. So don&#39;t take offense. It wasn&#39;t so much directed towards you as the people who are too lazy to read.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 24 Jan 2019 19:27:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Edgar is such a good soul.<br /><img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Fri, 25 Jan 2019 01:26:02 +0000</pubDate>
	</item>
</rss>
