<?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"
	>

<channel>
	<title>CanvasPaint blog</title>
	<atom:link href="http://canvaspaint.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://canvaspaint.org/blog</link>
	<description></description>
	<pubDate>Sun, 24 Feb 2008 17:42:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Code released into public domain</title>
		<link>http://canvaspaint.org/blog/2008/02/code-released-into-public-domain/</link>
		<comments>http://canvaspaint.org/blog/2008/02/code-released-into-public-domain/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 17:39:35 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2008/02/code-released-into-public-domain/</guid>
		<description><![CDATA[Since I have moved on to other projects, I hereby release the JavaScript code (http://canvaspaint.org/paint.js) into the wild: If this code, messy as it is, is of any use to you, feel free to take it.
This expressly does not include images, cursors or any other intellectual property, the rights to which I do not own [...]]]></description>
			<content:encoded><![CDATA[<p>Since I have moved on to <a href="http://www.soup.io">other projects</a>, I hereby release the JavaScript code (<a href="http://canvaspaint.org/paint.js">http://canvaspaint.org/paint.js</a>) into the wild: If this code, messy as it is, is of any use to you, feel free to take it.</p>
<p>This expressly does not include images, cursors or any other intellectual property, the rights to which I do not own myself.</p>
<p><a rel="license" href="http://creativecommons.org/licenses/publicdomain/"><br />
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/publicdomain/88x31.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2008/02/code-released-into-public-domain/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox 3 to support drawing text</title>
		<link>http://canvaspaint.org/blog/2007/09/firefox-3-to-support-drawing-text/</link>
		<comments>http://canvaspaint.org/blog/2007/09/firefox-3-to-support-drawing-text/#comments</comments>
		<pubDate>Sat, 22 Sep 2007 19:31:48 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2007/09/firefox-3-to-support-drawing-text/</guid>
		<description><![CDATA[Firefox 3 will provide these unstandardized, experimental methods:
mozDrawText();
mozMeasureText();
mozPathText();
mozTextAlongPath();
]]></description>
			<content:encoded><![CDATA[<p>Firefox 3 will provide <a href="http://developer.mozilla.org/en/docs/Canvas:Text">these unstandardized, experimental methods</a>:<br />
mozDrawText();<br />
mozMeasureText();<br />
mozPathText();<br />
mozTextAlongPath();</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2007/09/firefox-3-to-support-drawing-text/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CanvasPaint on the Wii</title>
		<link>http://canvaspaint.org/blog/2007/04/wii/</link>
		<comments>http://canvaspaint.org/blog/2007/04/wii/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 12:39:21 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[drawings]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2007/04/wii/</guid>
		<description><![CDATA[On April 1st, user YOSHI1999 over at the Nintendo forums posted a bunch of exclusive, totally non-fake screenshots from the upcoming Wii game &#8220;Super Smash Bros&#8221;.
What&#8217;s especially notable: These were all drawn inside the Wii&#8217;s Internet Channel (aka Opera), with the Wiimote. Amazing!
]]></description>
			<content:encoded><![CDATA[<p>On April 1st, user YOSHI1999 over at the Nintendo forums posted a bunch of <a href="http://forums.nintendo.com/nintendo/board/message?board.id=smash&#038;message.id=1316794&#038;view=by_date_ascending&#038;page=1">exclusive, totally non-fake screenshots</a> from the upcoming Wii game &#8220;Super Smash Bros&#8221;.</p>
<p>What&#8217;s especially notable: These were all drawn inside the <strong>Wii&#8217;s Internet Channel</strong> (aka Opera), with the Wiimote. Amazing!</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2007/04/wii/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Celebrity mentions</title>
		<link>http://canvaspaint.org/blog/2007/03/celebrity-mentions/</link>
		<comments>http://canvaspaint.org/blog/2007/03/celebrity-mentions/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 05:23:54 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[reactions]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2007/03/celebrity-mentions/</guid>
		<description><![CDATA[CanvasPaint was mentioned on Coding Horror the other day, in a quote of a Bruce Eckel article. Only he removed the link when he quoted that part. Boo hoo.
&#8220;&#8230;Someone did an imitation of the much simpler Microsoft Paint using HTML, CSS and JavaScript. Very impressive, but you get the sense that this is close to [...]]]></description>
			<content:encoded><![CDATA[<p>CanvasPaint was mentioned on <a href="http://www.codinghorror.com/blog/archives/000815.html">Coding Horror</a> the other day, in a quote of a <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=193593">Bruce Eckel</a> article. Only he removed the link when he quoted that part. Boo hoo.</p>
<blockquote><p>&#8220;&#8230;Someone did an imitation of the much simpler Microsoft Paint using HTML, CSS and JavaScript. Very impressive, but you get the sense that this is close to the limit of what those technologies can do&#8221;</p></blockquote>
<p>&mdash;Bruce Eckel</p>
<p>PS: This blog&#8217;s not dead. &#8220;It&#8217;s just resting!&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2007/03/celebrity-mentions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Saving canvas images with PHP</title>
		<link>http://canvaspaint.org/blog/2007/01/saving-images/</link>
		<comments>http://canvaspaint.org/blog/2007/01/saving-images/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 12:36:15 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2007/01/saving-images/</guid>
		<description><![CDATA[I&#8217;ve been asked for the source of save.php, which handles saving an image to the server.
In JavaScript, the data url of the canvas is posted to save.php over AJAX. (As an aside, this is the single usage of Ajax in CanvasPaint, so it really doesn&#8217;t deserve to be that prominent of a tag for the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://canvaspaint.org/d83.png">I&#8217;ve been asked</a> for the source of save.php, which handles saving an image to the server.</p>
<p>In JavaScript, the <a href="http://en.wikipedia.org/wiki/Data:_URI_scheme">data url</a> of the canvas is posted to save.php over AJAX. (As an aside, this is the single usage of Ajax in CanvasPaint, so it really doesn&#8217;t deserve to be that prominent of a tag for the site on <a href="http://del.icio.us/url/2a4906dacc2bc4849dc1b87e9fc1392d?settagview=list">del.icio.us</a>&#8230;)</p>
<pre>req.open("POST", "save.php", true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("u="+canvas.toDataURL());</pre>
<p>In PHP, <a href="http://php.net/base64_decode">base64_decode()</a> does all the magic:</p>
<p><code style="font-style:normal">$dataurl = str_replace(" ", "+", $_POST["u"]);<br />
$data = substr($dataurl, strpos($dataurl, &#8220;,&#8221;));</code></p>
<p><code style="font-style:normal">$file = f<strong></strong>open(&#8221;image.png&#8221;, &#8220;wb&#8221;);<br />
f<strong></strong>write($file, base64_decode($data));<br />
fclose($file);<br />
</code></p>
<p>Add a couple of security checks (mimetype, data url length, evil hax0ring attempts&#8230;) and filename generation, and you&#8217;re done.</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2007/01/saving-images/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Highlights #3</title>
		<link>http://canvaspaint.org/blog/2006/12/highlights3/</link>
		<comments>http://canvaspaint.org/blog/2006/12/highlights3/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 04:33:36 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[drawings]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2006/12/highlights3/</guid>
		<description><![CDATA[In the absence of real updates (which can currently be blamed on this), let&#8217;s see some more drawings:
           
See you in 2007.
]]></description>
			<content:encoded><![CDATA[<p>In the absence of real updates (which can currently be blamed on <a href="https://events.congress.ccc.de/congress/2006/Home">this</a>), let&#8217;s see some more drawings:</p>
<p><a href="http://canvaspaint.org/6e52.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.6e52.png" /></a> <a href="http://canvaspaint.org/272.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.272.png" /></a> <a href="http://canvaspaint.org/6e7f.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.6e7f.png" /></a> <a href="http://canvaspaint.org/98ca.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.98ca.png" /></a> <a href="http://canvaspaint.org/91dc.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.91dc.png" /></a> <a href="http://canvaspaint.org/d22.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.d22.png" /></a> <a href="http://canvaspaint.org/2ca5.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.2ca5.png" /></a> <a href="http://canvaspaint.org/7006.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.7006.png" /></a> <a href="http://canvaspaint.org/faa.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.faa.png" /></a> <a href="http://canvaspaint.org/621.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.621.png" /></a> <a href="http://canvaspaint.org/dff.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.dff.png" /></a> <a href="http://canvaspaint.org/3c08.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.3c08.png" /></a></p>
<p>See you in 2007.</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2006/12/highlights3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drawing an ellipse on &#60;canvas&#62;</title>
		<link>http://canvaspaint.org/blog/2006/12/ellipse/</link>
		<comments>http://canvaspaint.org/blog/2006/12/ellipse/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 13:59:04 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2006/12/ellipse/</guid>
		<description><![CDATA[This is just simple mathematics/geometry, but I remember googling for this for hours back when I first implemented the ellipse tool. Courtesy of Gavin Doughtie and Jon Stewart&#8217;s excellent presentation No Flash Required: Interactive Browser Graphics, this is how to draw an ellipse with bezier curves where x1/x2–y1/y2 is its bounding box.
var KAPPA = 4 [...]]]></description>
			<content:encoded><![CDATA[<p>This is just simple mathematics/geometry, but I remember googling for this for hours back when I first implemented the ellipse tool. Courtesy of Gavin Doughtie and Jon Stewart&#8217;s excellent presentation <a href="http://www.xdraw.org/oscon_slides/">No Flash Required: Interactive Browser Graphics</a>, this is how to draw an ellipse with bezier curves where x1/x2–y1/y2 is its bounding box.</p>
<pre>var KAPPA = 4 * ((Math.sqrt(2) -1) / 3);

var rx = (x2-x1)/2;
var ry = (y2-y1)/2;

var cx = x1+rx;
var cy = y1+ry;

trg.beginPath();
trg.moveTo(cx, cy - ry);
trg.bezierCurveTo(cx + (KAPPA * rx), cy - ry,  cx + rx, cy - (KAPPA * ry), cx + rx, cy);
trg.bezierCurveTo(cx + rx, cy + (KAPPA * ry), cx + (KAPPA * rx), cy + ry, cx, cy + ry);
trg.bezierCurveTo(cx - (KAPPA * rx), cy + ry, cx - rx, cy + (KAPPA * ry), cx - rx, cy);
trg.bezierCurveTo(cx - rx, cy - (KAPPA * ry), cx - (KAPPA * rx), cy - ry, cx, cy - ry);</pre>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2006/12/ellipse/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Highlights #2</title>
		<link>http://canvaspaint.org/blog/2006/12/highlights2/</link>
		<comments>http://canvaspaint.org/blog/2006/12/highlights2/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 21:22:21 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[drawings]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2006/12/highlights2/</guid>
		<description><![CDATA[           
]]></description>
			<content:encoded><![CDATA[<p><a href="http://canvaspaint.org/1a5a.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.1a5a.png" /></a> <a href="http://canvaspaint.org/38d6.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.38d6.png" /></a> <a href="http://canvaspaint.org/f3b3.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.f3b3.png" /></a> <a href="http://canvaspaint.org/87e4.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.87e4.png" /></a> <a href="http://canvaspaint.org/22d7.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.22d7.png" /></a> <a href="http://canvaspaint.org/705.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.705.png" /></a> <a href="http://canvaspaint.org/2fb5.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.2fb5.png" /></a> <a href="http://canvaspaint.org/573.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.573.png" /></a> <a href="http://canvaspaint.org/cf31.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.cf31.png" /></a> <a href="http://canvaspaint.org/4a0.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.4a0.png" /></a> <a href="http://canvaspaint.org/82c4.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.82c4.png" /></a> <a href="http://canvaspaint.org/852.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.852.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2006/12/highlights2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New feature: Flood fill</title>
		<link>http://canvaspaint.org/blog/2006/12/flood-fill/</link>
		<comments>http://canvaspaint.org/blog/2006/12/flood-fill/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 01:42:21 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[features]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2006/12/flood-fill/</guid>
		<description><![CDATA[This is only available in Opera 9 for now, and it&#8217;s pretty damn slow. Performance on Firefox 3/Gran Paradiso was even worse by a couple of magnitudes, so I haven&#8217;t enabled it there yet — I guess I&#8217;ll be benchmarking some different flood fill algorithms later this week.
]]></description>
			<content:encoded><![CDATA[<p>This is only available in Opera 9 for now, and it&#8217;s pretty damn slow. Performance on Firefox 3/Gran Paradiso was even worse by a couple of magnitudes, so I haven&#8217;t enabled it there yet — I guess I&#8217;ll be benchmarking some different <a href="http://student.kuleuven.be/~m0216922/CG/floodfill.html">flood fill algorithms</a> later this week.</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2006/12/flood-fill/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rendering text with &#60;canvas&#62;</title>
		<link>http://canvaspaint.org/blog/2006/12/rendering-text/</link>
		<comments>http://canvaspaint.org/blog/2006/12/rendering-text/#comments</comments>
		<pubDate>Sun, 10 Dec 2006 04:46:48 +0000</pubDate>
		<dc:creator>c3o</dc:creator>
		
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://canvaspaint.org/blog/2006/12/rendering-text/</guid>
		<description><![CDATA[One of the features most glaringly missing from CanvasPaint is text support. Quite a lot of the images saved online contain scrawly, hand-drawn text. Proper font support would obviously greatly improve the efficiency of spamming some website&#8217;s url and/or the word &#8220;dick&#8221; 50 times in a row. Unfortunately, the canvas spec does not address writing [...]]]></description>
			<content:encoded><![CDATA[<p><img width="197" height="82" align="left" alt=" hand-drawn text on canvas" id="image10" style="margin-right: 1em; margin-bottom: 1em" src="http://canvaspaint.org/blog/wp-content/uploads/2006/12/textcanvas.gif" />One of the features most glaringly missing from CanvasPaint is text support. Quite a lot of the <a href="/last.php">images saved online</a> contain scrawly, hand-drawn text. Proper font support would obviously greatly improve the efficiency of spamming some website&#8217;s url and/or the word &#8220;dick&#8221; 50 times in a row. Unfortunately, the <a href="http://whatwg.org/specs/web-apps/current-work/#the-2d">canvas spec</a> does not address writing text to a canvas apart from the following comment:</p>
<pre class="idl">// drawing text is not supported in this version of the API
// (there is no way to predict what metrics the fonts will have,
// which makes fonts very hard to use for painting)</pre>
<p>On the Mozilla wiki, there has been some <a href="http://wiki.mozilla.org/Canvas:Text">inconclusive discussion</a> about adding text rendering functionality, but it appears to have stalled.</p>
<p>So let&#8217;s explore some other options. The first thought is to somehow make use of the browser&#8217;s built-in perfect font handling capabilities (kerning/hinting, right-to-left, etc.), letting it render the font by itself and then somehow importing it into the canvas:</p>
<h3>1. Overlaying HTML</h3>
<p>One obvious technique that does this is simply layering divs with &#8220;real&#8221; text on top of a canvas. The nicest implementation of this principle is Oliver Steele&#8217;s <a href="http://osteele.com/sources/javascript/docs/textcanvas">TextCanvas</a> library. This approach works well enough, but of course the text is not actually rendered to the canvas and thus can&#8217;t be transformed, drawn over (unless you layer another canvas on top) or saved when you call toDataURL(), so it&#8217;s not a suitable solution for CanvasPaint.</p>
<h3>2. Rendering HTML with drawWindow()</h3>
<p>Mozilla supports a proprietary <a href="http://developer.mozilla.org/en/docs/Drawing_Graphics_with_Canvas#Rendering_Web_Content_Into_A_Canvas">drawWindow()</a> method, which would enable one to render some HTML text from a (potentially hidden) iframe to the canvas. However, that method is only accessible from chrome – ie. for extensions, where it is used to great effect for creating/displaying screenshots of web pages (TabPreview, etc). There&#8217;s <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=329693">a bug advocating allowing websites to access it as well</a>, but that too appears to be in hibernation.</p>
<p>So using the browser&#8217;s font rendering doesn&#8217;t seem to be working well enough. &#8220;No problem,&#8221; I hear you say, &#8220;then let&#8217;s reimplement it all from scratch!&#8221;. Alright, if you insist&#8230;</p>
<h3>3. Bitmap fonts with drawImage()</h3>
<p><a href="/font/bitmap/"><img id="image8" alt="Bitmap font on canvas" src="http://canvaspaint.org/blog/wp-content/uploads/2006/12/canvas_bitmap.gif" /></a></p>
<p>A <a href="http://en.wikipedia.org/wiki/Bitmap_font">bitmap font</a> is simply an image containing all characters of a font, which is then selectively drawn to the canvas. → <a style="font-weight: bold" href="/font/bitmap/">Try it out</a>.<br />
This works fairly well, but to make it look really nice, we&#8217;d need to create one such image per font size we&#8217;re intending to use.<br />
<a href="http://www.random.abrahamjoffe.com.au/public/JavaScripts/canvas/fonts.htm">Benjamin Joffe</a> has written a helpful <a href="http://www.random.abrahamjoffe.com.au/public/JavaScripts/canvas/fontGenerator.htm">bitmap font generator</a> to facilitate this task. For most canvas projects this is probably the way to go, even though it feels rather tedious and inflexible.</p>
<h3>4. Vector fonts</h3>
<p><a href="/font/postscript/"><img id="image9" alt="Postscript Type3 font on canvas" src="http://canvaspaint.org/blog/wp-content/uploads/2006/12/canvas_ps.gif" /></a></p>
<p>That finally leaves us with parsing actual vector font files. The two most commonly used formats are <a href="http://en.wikipedia.org/wiki/TrueType">TrueType </a> and <a href="http://en.wikipedia.org/wiki/Type_1_font">PostScript Type1</a> – both complex binary file formats, which we&#8217;ll hardly be able to parse in JavaScript.<br />
Thankfully a little tool called <a href="http://ttf2pt1.sourceforge.net/">TTF2PT1</a> allows us to convert a TrueType file into an ASCII Type1 (T1A) font. Suddenly, everthing becomes readable. Now the instructions for drawing Arial&#8217;s capital I look like so:</p>
<p><code>/I {<br />
[...]<br />
93 hmoveto<br />
95 hlineto<br />
716 vlineto<br />
-95 hlineto<br />
-716 vlineto<br />
closepath<br />
endchar }</code></p>
<p>It turns out to be quite easy to convert those lines for use with canvas with some simple hackish search/replace/turn-PS-stack-operators-into-JS-function-calls. We&#8217;ll just load the T1A file using AJAX and parse it in real time: → <a style="font-weight: bold" href="/font/postscript">Try it out</a>.</p>
<p>Some issues remain: At 150-200KB, those T1A files are pretty huge. To save on filesize and processing time, one could possibly pre-parse those into some made-up canvas font format, or at least remove all the lines the simple parser skips anyway.<br />
Most quality fonts include very specific and complex hinting information to optimize their display at small font sizes where simple antialiasing causes pixels to tend to smudge and run together. A reference implementation of how to handle hints might be <a href="hhttp://freetype.sourceforge.net/autohinting/hinter.html">FreeType&#8217;s Autohinter</a> (or possibly Ghostscript or <a href="http://gnuwin32.sourceforge.net/packages/t1lib.htm">T1Lib</a>?) Replicating all that in JavaScript would be quite a task&#8230; any volunteers?</p>
<p>Additionally, there are most likely licensing issues with putting font data online like that, if you&#8217;re not just planning on using <a href="http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html">open source fonts</a>. I suspect this is one of the reasons the efforts to enable embedding fonts in regular HTML (the DRM&#8217;ed <a href="http://www.microsoft.com/typography/web/embedding/default.aspx">EOT</a> and <a href="http://cgi.netscape.com/newsref/pr/newsrelease352.html">PFR</a>, as well as CSS2&#8217;s liberal <a href="http://www.w3.org/TR/REC-CSS2/fonts.html#font-descriptions"><code>@font-face</code></a>) never caught on.</p>
<p>So what to implement in CanvasPaint? I&#8217;m leaning towards a pre-parsed &#8220;canvasfont&#8221; version of Vera Sans&#8230; another entry for the todo list. Soon, important messages like these should be easier to create:</p>
<p><a href="http://canvaspaint.org/fb95.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.fb95.png" /></a> <a href="http://canvaspaint.org/1ce2.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.1ce2.png" /></a> <a href="http://canvaspaint.org/550.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.550.png" /></a> <a href="http://canvaspaint.org/5b4.png" rel="lightbox"><img src="http://canvaspaint.org/_thumb.5b4.png" /></a></p>
<p>[One final idea would be rendering the text server side with <a href="http://www.imagemagick.org">ImageMagick</a> or the like, and loading that into the canvas... but that'd be, like, totally lame, right?]</p>
<p>Update: The <a href="http://rhino-canvas.sourceforge.net/www/drawstring.html">RhinoCanvas project</a> has an in-depth suggestion for a drawString() method.</p>
]]></content:encoded>
			<wfw:commentRss>http://canvaspaint.org/blog/2006/12/rendering-text/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.851 seconds -->
