<?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>TikiRobot! &#187; canvas</title>
	<atom:link href="http://www.tikirobot.net/wp/tag/canvas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tikirobot.net/wp</link>
	<description>Mai Tais and Blinky Lights, Ahoy!</description>
	<lastBuildDate>Wed, 01 Feb 2012 22:14:15 +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>Canvas3D</title>
		<link>http://www.tikirobot.net/wp/2007/05/22/canvas3d/</link>
		<comments>http://www.tikirobot.net/wp/2007/05/22/canvas3d/#comments</comments>
		<pubDate>Tue, 22 May 2007 19:42:39 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[video]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[code code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/2007/05/22/canvas3d/</guid>
		<description><![CDATA[This video of a canvas3d/javascript demo in Firefox gives me hope. Some parts of my canvas(2d) web app runs 100x slower in Firefox/linux than Safari/OSX. It looks like they have hardware acceleration working, finally :) Here is some info on Canvas3d in javascript.]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/-VtR1KWSb5A"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/-VtR1KWSb5A" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
<p>This video of a canvas3d/javascript demo in Firefox gives me hope. Some parts of my canvas(2d) web app runs 100x slower in Firefox/linux than Safari/OSX. It looks like they have hardware acceleration working, finally :)</p>
<p>Here is <a href="http://wiki.mozilla.org/Canvas:3D/DevDayBoston0307">some info on Canvas3d in javascript.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2007/05/22/canvas3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to render text using HTML Canvas</title>
		<link>http://www.tikirobot.net/wp/2007/02/28/how-to-render-text-using-html-canvas/</link>
		<comments>http://www.tikirobot.net/wp/2007/02/28/how-to-render-text-using-html-canvas/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 22:59:30 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[typography]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[code code]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/2007/02/28/how-to-render-text-using-html-canvas/</guid>
		<description><![CDATA[I&#8217;ve been using HTML5 Canvas for a few web apps, and for the last year I&#8217;ve been avoiding rendering any text because Canvas lacks text support. Over the last year, several people have come up with workarounds. Firefox decided to add a non-standard method called drawWindow(), which lets you composite a hidden iframe with html [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using HTML5 Canvas for a few web apps, and for the last year I&#8217;ve been avoiding rendering any text because Canvas lacks text support. Over the last year, several people have come up with workarounds.</p>
<ul>
<li>Firefox decided to add <a href="http://developer.mozilla.org/en/docs/Drawing_Graphics_with_Canvas#Rendering_Web_Content_Into_A_Canvas">a non-standard method called drawWindow()</a>, which lets you composite a hidden iframe with html text.
<li>The <a href="http://osteele.com/sources/javascript/docs/textcanvas">TextCanvas project</a> adds a drawString method to the canvas api, which positions a HTML element on top of the canvas.
<li>The <a href="http://www.random.abrahamjoffe.com.au/public/JavaScripts/canvas/fonts.htm">Variable Width Canvas Fonts</a> project pre-generates an image containing characters at known locations and then uses drawImage to display the necessary characters.
<li>The very cool <a href="http://canvaspaint.org">CanvasPaint</a> project went nuts and <a href="http://canvaspaint.org/font/postscript/">implemented vector fonts in canvas!</a> (more info <a href="http://canvaspaint.org/blog/2006/12/rendering-text/">here</a>)
<li>None of the above links work in Safari. Despite being the original developers of Canvas, Safari&#8217;s Canvas support is extremely buggy. Things work better with the nightly builds, but even then, many things are broken.
</ul>
<p>I&#8217;ve been thinking about giving up on supporting Safari completely, and maybe trying out <a href="http://dojotoolkit.org">dojo&#8217;s gfx 2D graphics API</a>, which has text support but uses SVG/VML instead of Canvas. For the time being though, I found a silly workaround. Since I only need to display numbers, I can just create 10 pngs, one for each digit. Here is a bash script that creates the number pngs using ImageMagick:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">i</span>=<span style="color: #000000;">0</span>;i<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000;">10</span>;i++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span> 
     convert <span style="color: #660033;">-size</span> 75x100 xc:transparent <span style="color: #660033;">-quality</span> <span style="color: #000000;">100</span> <span style="color: #660033;">-font</span> Courier-Bold <span style="color: #660033;">-pointsize</span> <span style="color: #000000;">144</span> <span style="color: #660033;">-fill</span> green <span style="color: #660033;">-draw</span> <span style="color: #ff0000;">&quot;text -5,95 '<span style="color: #007800;">$i</span>'&quot;</span> g<span style="color: #007800;">$i</span>.png; 
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Here&#8217;s a blurry screenshot of how it looks:<br />
<img id="image929" src="http://www.tikirobot.net/wp/wp-content/uploads/2007/02/6.jpg" alt="6.jpg" width="500" height="115"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2007/02/28/how-to-render-text-using-html-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSPaint implemented using HTML Canvas</title>
		<link>http://www.tikirobot.net/wp/2006/12/05/mspaint-implemented-using-html-canvas/</link>
		<comments>http://www.tikirobot.net/wp/2006/12/05/mspaint-implemented-using-html-canvas/#comments</comments>
		<pubDate>Wed, 06 Dec 2006 06:17:17 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[canvas]]></category>
		<category><![CDATA[code code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/2006/12/05/mspaint-implemented-using-html-canvas/</guid>
		<description><![CDATA[You know how I&#8217;m always talking about how HTML Canvas is going to enable all kinds of new and interesting web apps? Well, someone implemented MSPaint in Javascript using Canvas! You KNOW someone out there is working on a Canvas version MacPaint&#8230; or how about a Canvas version of System 7???]]></description>
			<content:encoded><![CDATA[<p><img id="image704" src="http://www.tikirobot.net/wp/wp-content/uploads/2006/12/mspaint.thumbnail.png" alt="mspaint.png" width="96" height="89" align="right"/>You know how I&#8217;m <a href="http://www.tikirobot.net/wp/2006/08/03/javascript-gets-block-level-scope/">always</a> <a href="http://www.tikirobot.net/wp/2006/08/04/explorercanvas-enables-html-canvas-on-ie/">talking</a> about how HTML Canvas is going to enable all kinds of new and interesting web apps? Well, someone <a href="http://canvaspaint.org/">implemented MSPaint in Javascript using Canvas!</a> You KNOW someone out there is working on a Canvas version <a href="http://www.folklore.org/StoryView.py?project=Macintosh&#038;story=MacPaint_Evolution.txt">MacPaint</a>&#8230; or how about a Canvas version of <a href="http://www.tikirobot.net/wp/2006/03/16/system-7-today/">System 7</a>???</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2006/12/05/mspaint-implemented-using-html-canvas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

