<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tequila Fish &#187; webcore</title>
	<atom:link href="http://www.tequilafish.com/tag/webcore/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tequilafish.com</link>
	<description>Ran-dumb ramblings of me...</description>
	<lastBuildDate>Thu, 26 Jan 2012 23:30:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP &amp; imagettftext with Webcore TrueType fonts.</title>
		<link>http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/</link>
		<comments>http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 21:37:12 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[imagegettftext]]></category>
		<category><![CDATA[truetype]]></category>
		<category><![CDATA[webcore]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/</guid>
		<description><![CDATA[If you're trying to write some text using PHP/GD &#038; the imagettftext() function, you will of course need some TrueType fonts to work with. I've found a great set of fonts available for free: Webcore. Webcore contains all the fonts web designers constantly use, things like Arial, Tahoma, Verdana, Georgia, etc.. To install, simply download [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F07%2F21%2Fphp-imagettftext-with-webcore-truetype-fonts%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F07%2F21%2Fphp-imagettftext-with-webcore-truetype-fonts%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you're trying to write some text using PHP/GD &#038; the <tt>imagettftext()</tt> function, you will of course need some TrueType fonts to work with.  I've found a great set of fonts available for free: <a href="http://avi.alkalay.net/software/webcore-fonts/">Webcore</a>.  Webcore contains all the fonts web designers constantly use, things like Arial, Tahoma, Verdana, Georgia, etc..</p>
<p>To install, simply download to your server and install the RPM (Fedora):<br />
<code>shell&gt; wget http://avi.alkalay.net/software/webcore-fonts/webcore-fonts-3.0-1.noarch.rpm<br />
shell&gt; rpm -i webcore-fonts-3.0-1.noarch.rpm</code></p>
<p>These fonts will now be available to you in <strong><tt>/usr/share/fonts/webcore/</tt></strong>.</p>
<p>Make sure you specify the full path when calling <tt>imagettftext()</tt>, eg:<br />
<code>&lt;?php<br />
&nbsp;<br />
// Set the content-type<br />
header("Content-type: image/png");<br />
&nbsp;<br />
// Replace path by your own font path<br />
$font = '/usr/share/fonts/webcore/arial.ttf';<br />
&nbsp;<br />
// Create the image<br />
$im = imagecreatetruecolor(400, 30);<br />
&nbsp;<br />
// Create some colors<br />
$white = imagecolorallocate($im, 255, 255, 255);<br />
$black = imagecolorallocate($im, 0, 0, 0);<br />
imagefilledrectangle($im, 0, 0, 399, 29, $white);<br />
&nbsp;<br />
// The text to draw<br />
$text = 'Hello world!';<br />
&nbsp;<br />
// Add some text<br />
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);<br />
&nbsp;<br />
// Using imagepng() results in clearer text compared with imagejpeg()<br />
imagepng($im);<br />
imagedestroy($im);<br />
?&gt;</code></p>
<p>Your mileage may vary if you are using a different distribution, but the docs state that this RPM should work on other distros.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

