<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: TIC &#8211; Text Image Converter</title>
	<atom:link href="http://www.andreabelvedere.com/coding/tic-text-image-converter/feed" rel="self" type="application/rss+xml" />
	<link>http://www.andreabelvedere.com/coding/tic-text-image-converter</link>
	<description>Coding, Life</description>
	<lastBuildDate>Thu, 22 Jul 2010 03:51:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: andrea belvedere</title>
		<link>http://www.andreabelvedere.com/coding/tic-text-image-converter/comment-page-1#comment-320</link>
		<dc:creator>andrea belvedere</dc:creator>
		<pubDate>Mon, 27 Jul 2009 11:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreabelvedere.com/?p=356#comment-320</guid>
		<description>Hi Martin,
I am not sure I have fully understood what you are asking, however I have run this test with a Japanese font and it works perfectly:
&lt;pre lang=&quot;PHP&quot;&gt;
&lt;?php
require_once dirname($_SERVER[&#039;DOCUMENT_ROOT&#039;]) . &#039;/tic/lib/tic.php&#039;;

$fontfile = dirname($_SERVER[&#039;DOCUMENT_ROOT&#039;]) . &#039;/tic/fonts/ttf-japanese-mincho.ttf&#039;;
$tic = TIC::factory($fontfile);
$tic-&gt;setText(&#039;アンドレア&#039;)
-&gt;setBackground(0xaa, 0xaa, 0xaa)
-&gt;setColor(array(0x00, 0x00, 0x00))
-&gt;setPadding(5)
-&gt;create(true); // create and output
?&gt;
&lt;/pre&gt;

And the output is here below:
&lt;img src=&quot;http://www.andreabelvedere.com/wp-content/uploads/2009/07/andrea.png&quot; alt=&quot;andrea&quot; /&gt;

In your case you will pass text to &lt;code&gt;setText&lt;/code&gt; as follow: &lt;code&gt;setText($unicode);&lt;/code&gt; where &lt;code&gt;$unicode&lt;/code&gt; will hold your unicode string from the database.
Hope this helps.
Andrea</description>
		<content:encoded><![CDATA[<p>Hi Martin,<br />
I am not sure I have fully understood what you are asking, however I have run this test with a Japanese font and it works perfectly:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/tic/lib/tic.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$fontfile</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/tic/fonts/ttf-japanese-mincho.ttf'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tic</span> <span style="color: #339933;">=</span> TIC<span style="color: #339933;">::</span><span style="color: #004000;">factory</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fontfile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tic</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'アンドレア'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBackground</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0xaa</span><span style="color: #339933;">,</span> <span style="color: #208080;">0xaa</span><span style="color: #339933;">,</span> <span style="color: #208080;">0xaa</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setColor</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0x00</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x00</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x00</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPadding</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// create and output</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And the output is here below:<br />
<img src="http://www.andreabelvedere.com/wp-content/uploads/2009/07/andrea.png" alt="andrea" /></p>
<p>In your case you will pass text to <code>setText</code> as follow: <code>setText($unicode);</code> where <code>$unicode</code> will hold your unicode string from the database.<br />
Hope this helps.<br />
Andrea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.andreabelvedere.com/coding/tic-text-image-converter/comment-page-1#comment-319</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Sun, 26 Jul 2009 18:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreabelvedere.com/?p=356#comment-319</guid>
		<description>How is it possible to generate images from TTF fonts for chinese characters? I do not know how to get those UNICODE characters as arguments to setText. I did also try to use the PHP image library directly but ran into similar problems, the PHP-chr() function allows only ASCII.

I do have TTF font files (from university of Heidelberg) and want to generate chinese texts from a database using PHP.</description>
		<content:encoded><![CDATA[<p>How is it possible to generate images from TTF fonts for chinese characters? I do not know how to get those UNICODE characters as arguments to setText. I did also try to use the PHP image library directly but ran into similar problems, the PHP-chr() function allows only ASCII.</p>
<p>I do have TTF font files (from university of Heidelberg) and want to generate chinese texts from a database using PHP.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
