<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>default &quot;font&quot; in Allegro5</title>
		<link>http://www.allegro.cc/forums/view/613729</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 03 Jan 2014 22:01:48 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello all,<br />I&#39;m trying to convert an Allegro 4.2 program into Allegro 5.<br />Is the default font (called &#39;font&#39;) still existing?<br />Thank you in advance.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (anto80)</author>
		<pubDate>Thu, 02 Jan 2014 19:41:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Pretty sure there isn&#39;t, but using ttf fonts isn&#39;t hard.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;allegro5/allegro_ttf.h&gt;    //true type font handling</span>
<span class="number">  2</span>
<span class="number">  3</span><span class="k1">char</span> ttf_filename<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">"DejaVuSans.ttf"</span><span class="k2">;</span>
<span class="number">  4</span>
<span class="number">  5</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">int</span> argc, <span class="k1">char</span> <span class="k3">*</span><span class="k3">*</span>argv<span class="k2">)</span>
<span class="number">  6</span><span class="k2">{</span>
<span class="number">  7</span> yadda
<span class="number">  8</span> yadda
<span class="number">  9</span><a href="http://www.allegro.cc/manual/ALLEGRO_FONT"><span class="a">ALLEGRO_FONT</span></a> <span class="k3">*</span>myfont<span class="k2">;</span>    <span class="c">//Pointer to our True Type font</span>
<span class="number"> 10</span><a href="http://www.allegro.cc/manual/ALLEGRO_COLOR"><span class="a">ALLEGRO_COLOR</span></a> white<span class="k2">;</span>      <span class="c">//a color for text output</span>
<span class="number"> 11</span> yadda
<span class="number"> 12</span> yadda
<span class="number"> 13</span>  <a href="http://www.allegro.cc/manual/al_init_font_addon"><span class="a">al_init_font_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>  <a href="http://www.allegro.cc/manual/al_init_ttf_addon"><span class="a">al_init_ttf_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span> yadda
<span class="number"> 16</span> yadda
<span class="number"> 17</span>  white <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">255</span>,<span class="n">255</span><span class="k2">)</span><span class="k2">;</span>  <span class="c">//set color values to match the names</span>
<span class="number"> 18</span>
<span class="number"> 19</span>  myfont <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_font"><span class="a">al_load_font</span></a><span class="k2">(</span>ttf_filename,<span class="k3">-</span><span class="n">28</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>  <span class="c">//the negative sign means use 28 pixels high rather than 28 points (supposedly 72'nds of an inch)</span>
<span class="number"> 20</span>  <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span>myfont<span class="k2">)</span>
<span class="number"> 21</span>  <span class="k2">{</span>
<span class="number"> 22</span>          error stuff
<span class="number"> 23</span>  <span class="k2">}</span>
<span class="number"> 24</span>
<span class="number"> 25</span><span class="c">//in render loop</span>
<span class="number"> 26</span><a href="http://www.allegro.cc/manual/al_draw_textf"><span class="a">al_draw_textf</span></a><span class="k2">(</span>myfont,white,<span class="n">20</span>.<span class="n">0</span>,<span class="n">70</span>.<span class="n">0</span>,<span class="n">0</span>,<span class="s">"cumulative frames      %8u"</span>,frames<span class="k2">)</span><span class="k2">;</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Thu, 02 Jan 2014 19:53:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s not built in, but allegro distributes the old a4 font with the examples.</p><p>Look for &#39;examples/data/a4_font.tga&#39;.</p><p>I wouldn&#39;t choose that font for anything these days. If you need a small fixed width font, there are many better ones to choose from.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 02 Jan 2014 20:06:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I agree with you all:<br />- Using TTF is not hard (and well documented)<br />- It is possible to load the old a4 font (which is distributed as a bitmap)<br />but the thing I was trying to do was to display text without the need to use an external file (even if it is ugly)<br />Thanks anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (anto80)</author>
		<pubDate>Thu, 02 Jan 2014 20:23:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613729/994677#target">anto80</a> said:</div><div class="quote"><p> display text without the need to use an external file</p></div></div><p>You might be able to include it into the executable as binary and use some sort of memfile function, but it&#39;s more work than I want to try.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Thu, 02 Jan 2014 20:33:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can convert the file to a C array, and feed that into a memfile as Arthur hinted at, then use the <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_bitmap_f"><span class="a">al_load_bitmap_f</span></a></span> to &quot;load&quot; the image.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 02 Jan 2014 20:37:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;re using gcc, you could use <a href="http://www.burtonini.com/blog/computers/ld-blobs-2007-07-13-15-50">this</a>, for other compilers I don&#39;t know, but then you could use the NASM assembler with the %incbin directive along with the object format command line option needed so you can link it in like any other object file.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Thu, 02 Jan 2014 20:44:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Err... what?</p><p><a href="http://alleg.sourceforge.net/a5docs/5.0.10/font.html#al_create_builtin_font">al_create_builtin_font</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 02 Jan 2014 20:54:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A great big ODARN echos through the trailer park!  I was searching for &quot;default font&quot; etc.</p><p>OTOH, 8x8 is too small to be reasonably legible for modern screen pitches.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Thu, 02 Jan 2014 21:01:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You could always scale it up using transformations, but in principle it&#39;s only meant to be used for debugging.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 02 Jan 2014 21:09:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>whups. I thought it wasn&#39;t there for some reason <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 02 Jan 2014 22:18:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks again for all new replies.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (anto80)</author>
		<pubDate>Fri, 03 Jan 2014 22:01:48 +0000</pubDate>
	</item>
</rss>
