<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Can I Draw Scaled Text?</title>
		<link>http://www.allegro.cc/forums/view/617678</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 01 Jan 2019 09:32:29 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi everybody,</p><p>There is a way to draw scaled text in both axes?</p><p>For TTF, i can resize the textsize with size parameter; but on Bitmap Font, i&#39;m trying to resize the loaded bitmap to make my font smallest but al_grab_font_from_bitmap return me False.</p><p>I think when my bitmap was resized, i lost the bounding box line.</p><p><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /></p><p>Anyone have any idea to make it work? or give me another solution to &quot;scaled text&quot;???
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (chanochambure)</author>
		<pubDate>Mon, 31 Dec 2018 06:10:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Scaling your bitmap font before passing it to <span class="source-code"><a href="http://www.allegro.cc/manual/al_grab_font_from_bitmap"><span class="a">al_grab_font_from_bitmap</span></a></span> won&#39;t work. This function requires pixel-perfect precision from the passed bitmap; scaling it beforehand will do weird things with the gaps between the characters. If you&#39;ve enabled texture smoothing, the gaps will actually become blurred - meaning you have absolutely no chance <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>The best way of dealing with this would be to load your bitmap font normally, then use <a href="https://liballeg.org/a5docs/trunk/transformations.html">transformations</a> to scale the result of <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a></span>.</p><p>For example, to scale your text to twice the size:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/ALLEGRO_TRANSFORM"><span class="a">ALLEGRO_TRANSFORM</span></a> tr<span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_identity_transform"><span class="a">al_identity_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>tr<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_scale_transform"><span class="a">al_scale_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>tr, <span class="n">2</span>, <span class="n">2</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_use_transform"><span class="a">al_use_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>tr<span class="k2">)</span><span class="k2">;</span>

<a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/font"><span class="a">font</span></a>, <a href="http://www.allegro.cc/manual/al_map_rgb_f"><span class="a">al_map_rgb_f</span></a><span class="k2">(</span><span class="n">1</span>,<span class="n">1</span>,<span class="n">1</span><span class="k2">)</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"t h i c c"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Mon, 31 Dec 2018 16:45:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks dthompson, i&#39;m using doing a transform in scale and position. And after drawing setting identity transform.</p><p>Thanks for the tip! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (chanochambure)</author>
		<pubDate>Tue, 01 Jan 2019 09:32:29 +0000</pubDate>
	</item>
</rss>
