<?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>lalit.org &#187; opensource</title>
	<atom:link href="http://www.lalit.org/tag/opensource/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lalit.org</link>
	<description>Personal page of Lalit Patel, an engineer, entrepreneur, geek from Bhubaneswar, India.</description>
	<lastBuildDate>Thu, 03 Jun 2010 05:23:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Extending Prototype</title>
		<link>http://www.lalit.org/lab/extending-prototype-building-extensions-to-prototypejs</link>
		<comments>http://www.lalit.org/lab/extending-prototype-building-extensions-to-prototypejs#comments</comments>
		<pubDate>Sun, 09 Sep 2007 05:58:17 +0000</pubDate>
		<dc:creator>Lalit</dc:creator>
				<category><![CDATA[lab]]></category>
		<category><![CDATA[delhi]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://www.lalit.org/?p=23</guid>
		<description><![CDATA[A talk I gave at OSSCamp Delhi about creating reusable addons/extensions to Prototype.js


 &#124; View &#124; Upload your own

]]></description>
			<content:encoded><![CDATA[<p>A talk I gave at <a href="http://www.osscamp.in/" target="_blank">OSSCamp</a> <a href="http://www.osscamp.in/index.php/OSSCampDelhi" target="_blank">Delhi</a> about creating reusable addons/extensions to <a title="prototype.js Javascript Library" href="http://www.prototypejs.org" target="_blank">Prototype.js</a><br />
<span id="more-23"></span></p>
<div id="__ss_106333" style="width:425px;text-align:left"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=extending-prototype-lalit-patel1053" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=extending-prototype-lalit-patel1053" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"><a href="http://www.slideshare.net/?src=embed"><img style="border:0px none;margin-bottom:-5px" src="http://static.slideshare.net/swf/logo_embd.png" alt="SlideShare" /></a> | <a title="View Extending Prototype Lalit Patel on SlideShare" href="http://www.slideshare.net/lalitpatel/extending-prototype-lalit-patel?src=embed">View</a> | <a href="http://www.slideshare.net/upload?src=embed">Upload your own</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.lalit.org/lab/extending-prototype-building-extensions-to-prototypejs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookie Jar: Yummy JSON Cookies (using Prototype)</title>
		<link>http://www.lalit.org/lab/jsoncookies</link>
		<comments>http://www.lalit.org/lab/jsoncookies#comments</comments>
		<pubDate>Thu, 12 Apr 2007 07:09:16 +0000</pubDate>
		<dc:creator>Lalit</dc:creator>
				<category><![CDATA[lab]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.lalit.org/?p=20</guid>
		<description><![CDATA[JavaScript code to store data as JSON strings in cookies. It uses prototype.js to store and retrieve JSON data from cookies.
Now we can store and retrieve JavaScript Objects, Arrays, Boolean, String, Number values using cookies, just like storing Java Objects in session on the server side.

Works with Firefox 1.5, 2.0, IE 6.0 and Opera 9.10.
Example
(Execute [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript code to store data as JSON strings in cookies. It uses <a href="http://www.prototypejs.org/" target="_blank">prototype.js</a> to store and retrieve JSON data from cookies.</p>
<p>Now we can store and retrieve JavaScript Objects, Arrays, Boolean, String, Number values using cookies, just like storing Java Objects in session on the server side.<br />
<span id="more-20"></span><br />
Works with Firefox 1.5, 2.0, IE 6.0 and Opera 9.10.</p>
<h3>Example</h3>
<p>(Execute this example)</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> CookieJar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">expires<span style="color: #339933;">:</span><span style="color: #CC0000;">3600</span><span style="color: #339933;">,</span>   <span style="color: #006600; font-style: italic;">// seconds</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">path<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/'</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">dog <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'Jacky'</span><span style="color: #339933;">,</span> breed<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Alsatian'</span><span style="color: #339933;">,</span> age<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jar.<span style="color: #660066;">put</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mydog'</span><span style="color: #339933;">,</span> dog<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mydog <span style="color: #339933;">=</span> jar.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mydog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;My dog's name is &quot;</span> <span style="color: #339933;">+</span> mydog.<span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;He is &quot;</span> <span style="color: #339933;">+</span> mydog.<span style="color: #660066;">age</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; years old&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;He is an &quot;</span> <span style="color: #339933;">+</span> mydog.<span style="color: #660066;">breed</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre></div></div>

<h3>Download</h3>
<p>You can view the source code <a href="http://www.lalit.org/wordpress/wp-content/uploads/2008/06/cookiejar.js">here</a>.<br />
<del datetime="2009-01-25T06:10:56+00:00">This code is released under <a href="http://creativecommons.org/licenses/by-sa/2.5/" target="_blank">CC Attribution-ShareAlike 2.5</a></del></p>
<p>This code is released under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache Software License</a>.</p>
<h3 class="bold">API</h3>
<p><code><strong>CookieJar</strong>(options)</code><br />
Constructor. Takes in a object as options.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">expires<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span>  <span style="color: #006600; font-style: italic;">// time in seconds (defualt: 3600)</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">path<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span>     <span style="color: #006600; font-style: italic;">// cookie path</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">domain<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span>   <span style="color: #006600; font-style: italic;">// cookie domain</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">secure<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span>    <span style="color: #006600; font-style: italic;">// secure ?</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div></li></ol></pre></div></div>

<p><code>boolean <strong>put</strong>(string name, mixed value)</code><br />
Puts a particular cookie in the cookie jar. The cookie is associated  with the name. Returns false if cannot add cookie (Ex: max cookie size  exceeded!). Returns true on success.</p>
<p><code>mixed <strong>get</strong>(string name)</code><br />
Gets a particular cookie from the cookie jar. Returns null if not found.</p>
<p><code>boolean <strong>remove</strong>(string name)</code><br />
Removes a particular cookie from the cookie jar. Returns true on success, false otherwise.</p>
<p><code>void <strong>empty</strong>()</code><br />
Empties the Cookie Jar.</p>
<p><code>array <strong>getKeys</strong>()</code><br />
Gets array of all the cookie names.</p>
<p><code>object <strong>getPack</strong>()</code><br />
Gets all the cookies as a single JavaScript object (Package) with name value pairs.</p>
<h3>Change Log</h3>
<p><small><strong>v 0.5</strong> (26-Jan-09)</small></p>
<ol>
<li>Changed the License to Apache Software License 2.0</li>
</ol>
<p><small><strong>v 0.4</strong> (11-Aug-07)</small></p>
<ol>
<li>Removed a extra comma in options (was breaking in IE and Opera). (Thanks Jason)</li>
<li>Removed the parameter name from the initialize function</li>
<li>Changed the way expires date was being calculated. (Thanks David)</li>
</ol>
<p><small><strong>v 0.3</strong> (22-Jun-07)</small></p>
<ol>
<li>Removed dependancy on json.js (<a href="http://web.archive.org/web/20070819092735/http://www.json.org/json.js">http://www.json.org/json.js</a>)</li>
<li><span class="code">empty()</span> function only deletes the cookies set by CookieJar. Leaves alone other cookies like <span class="code">session_id</span> etc.</li>
</ol>
<p><small><strong>v 0.2</strong> (12-Apr-07)</small></p>
<ol>
<li>Released for public use.</li>
</ol>
<h3>Related</h3>
<ul>
<li><a href="http://ajaxian.com/archives/cookiejar-json-cookies">Ajaxian review</a></li>
<li><a href="http://clientside.cnet.com/code-snippets/cookiejsonjs-a-mootools-version-of-cookiejar/" target="_blank">MooTools port</a></li>
<li><a href="http://www.jdempster.com/2007/08/11/jquery-cookiejar/" target="_blank">jQuery port</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lalit.org/lab/jsoncookies/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>JavaScript/CSS Font Detector</title>
		<link>http://www.lalit.org/lab/javascript-css-font-detect</link>
		<comments>http://www.lalit.org/lab/javascript-css-font-detect#comments</comments>
		<pubDate>Sat, 10 Mar 2007 05:49:58 +0000</pubDate>
		<dc:creator>Lalit</dc:creator>
				<category><![CDATA[lab]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.orissabiz.com/?p=10</guid>
		<description><![CDATA[JavaScript code to detect available availability of a particular font in a browser using JavaScript and CSS.

I wrote a JavaScript code which can be used to guess if a particular font is present in a machine. This may be help of desktop-like web application developers when they want to provide different skins or fonts preferences [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript code to detect available availability of a particular font in a browser using JavaScript and CSS.<br />
<span id="more-10"></span><br />
I wrote a JavaScript code which can be used to guess if a particular font is present in a machine. This may be help of desktop-like web application developers when they want to provide different skins or fonts preferences to their users. This may also be help for blog skin designers which can provide different fonts for different users based on the list of fonts on their machine. Designers don&#8217;t have to rely on the most common fonts like Arial, Verdana or Times New Roman. Since increasing number of users have modern PC with new operating system / applications, they may very well have a wide array of other common fonts in their machine.</p>
<h3>How does it work?</h3>
<p>This code works on the simple principle that each character appears differently in different fonts. So different fonts will take different width and height for the same string of characters of same font-size.</p>
<p><a href="http://www.lalit.org/wordpress/wp-content/uploads/2008/05/fontwidth.gif"><img class="alignnone size-full wp-image-11" title="Widths of same text in different fonts" src="http://www.lalit.org/wordpress/wp-content/uploads/2008/05/fontwidth.gif" alt="Widths of same text in different fonts" width="390" height="113" /></a></p>
<p>We try to create a string with a specified font-face. If the font-face is not available, it takes up the font-face of the parent element. We then compare the width of the string with the specified font-face and width of the string with the font-face of the parent element, if they are different, then the font exists, otherwise not.</p>
<p>The string which we will use to generate the widths can be anything. But I guess we use &#8216;m&#8217; or &#8216;w&#8217; because these two characters take up the maximum width. And we use a trailing &#8216;l&#8217; so that the same width fonts-faces can get separated based on the width of l character.</p>
<p>I have tested it on Firefox 2, 3, 3.5 IE 6, IE 7, Opera 9, Opera 10.</p>
<p><span style="color: red;"><sup>Update</sup></span> Now works on Opera 9.10. It required to execute the script after its completely loaded. I guess, Opera cannot calculate the offset width until all the parents are completely loaded.</p>
<p><span style="color: red;"><sup>Update (10-Jul-09)</sup></span> Fixed the Tests failing on Firefox 3 issue. changed comparison font to serif from sans-serif, as in FF3.0 font-face of child element didn&#8217;t fallback to font-face of parent element if the font-face of child element is missing.</p>
<h3>Download</h3>
<p>Get the JavaScript code <a href="http://www.lalit.org/wordpress/wp-content/uploads/2008/05/fontdetect.js?ver=1.5" target="_blank">here</a>.</p>
<p>Released under <a href="http://creativecommons.org/licenses/by-sa/2.5/" target="_blank">CC Attribution-ShareAlike 2.5</a></p>
<p>You can also see Lemmi&#8217;s version of the script as <b>Prototype plug-in</b> <a href="#comment-6776">here</a>.</p>
<h3>Demo</h3>
<p>You can test any Font here:</p>
<input id="newfont" style="padding:2px" type="text" />
<input onclick="alert(d.test($('newfont').value))" type="button" value="Test" />

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #006600; font-style: italic;">// Usage</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> detective <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Detector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>detective.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font name'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre></div></div>

<h3>Fonts on your computer</h3>
<p>This table below shows which fonts are present on your system. (I have listed some of the most common and some uncommon fonts.)</p>
<p><a href="http://exhibit.ecmanaut.googlepages.com/" target="_blank">Johan Sundström</a> has presented this data in a more interesting and cool layout <a href="http://exhibit.ecmanaut.googlepages.com/installed-fonts.html" target="_blank">here</a>. Thanks Johan!</p>
<table id="table" class="_table" border="1" cellspacing="0" cellpadding="5" width="100%" bordercolor="#cccccc">
<tbody>
<tr>
<th>Font Name</th>
<th>Width</th>
<th>Height</th>
<th>Detected?</th>
</tr>
</tbody>
</table>
<p><script type="text/javascript">// <![CDATA[
	/**
	 * Actual function that does all the work. Returns an array with all the info.
	 * My Assumption is that most of the browsers will have arial set as their default sans-serif font.
	 */
	var Detector = function(){
		var h = document.getElementsByTagName("BODY")[0];
		var d = document.createElement("DIV");
		var s = document.createElement("SPAN");
		d.appendChild(s);
		d.style.fontFamily = "serif";		//font for the parent element DIV.
		s.style.fontFamily = "serif";		//have to use serif coz in FF3.0, it doesn't fall back to font of parent element.
		s.style.fontSize   = "72px";			//we test using 72px font size, we may use any size. I guess larger the better.
		s.innerHTML        = "mmmmmmmmmml";		//we use m or w because these two characters take up the maximum width. And we use a L so that the same matching fonts can get separated
		h.appendChild(d);
		var defaultWidth   = s.offsetWidth;		//now we have the defaultWidth
		var defaultHeight  = s.offsetHeight;	//and the defaultHeight, we compare other fonts with these.
		h.removeChild(d);
		/* test
		 * params:
		 * font - name of the font you wish to detect
		 * return:
		 * f[0] - Input font name.
		 * f[1] - Computed width.
		 * f[2] - Computed height.
		 * f[3] - Detected? (true/false).
		 */
        function debug(font) {
                h.appendChild(d);
                var f = [];
                f[0] = s.style.fontFamily = font;       // Name of the font
                f[1] = s.offsetWidth;                           // Width
                f[2] = s.offsetHeight;                          // Height
                h.removeChild(d);
                font = font.toLowerCase();
                if (font == "serif") {
                        f[3] = true;    // to set arial and sans-serif true
                } else {
                        f[3] = (f[1] != defaultWidth || f[2] != defaultHeight); // Detected?
                }
                return f;
        }
        function test(font){
                f = debug(font);
                return f[3];
        }
        this.detailedTest = debug;
      this.test = test;
	}
	var fonts = [];
	/**
	 * other stuff
	 */
	function init() {
		fonts.push("cursive");
		fonts.push("monospace");
		fonts.push("serif");
		fonts.push("sans-serif");
		fonts.push("fantasy");
		fonts.push("default");
		fonts.push("Arial");
		fonts.push("Arial Black");
		fonts.push("Arial Narrow");
		fonts.push("Arial Rounded MT Bold");
		fonts.push("Bookman Old Style");
		fonts.push("Bradley Hand ITC");
		fonts.push("Century");
		fonts.push("Century Gothic");
		fonts.push("Comic Sans MS");
		fonts.push("Courier");
		fonts.push("Courier New");
		fonts.push("Georgia");
		fonts.push("Gentium");
		fonts.push("Impact");
		fonts.push("King");
		fonts.push("Lucida Console");
		fonts.push("Lalit");
		fonts.push("Modena");
		fonts.push("Monotype Corsiva");
		fonts.push("Papyrus");
		fonts.push("Tahoma");
		fonts.push("TeX");
		fonts.push("Times");
		fonts.push("Times New Roman");
		fonts.push("Trebuchet MS");
		fonts.push("Verdana");
		fonts.push("Verona");
		d = new Detector();
		// compute height and width for all fonts
		for (i=0; i<fonts.length; i++) {
			fonts.push(d.detailedTest(fonts.shift()));
		}
		//sortResults();
		listResults();
	}
	function listResults() {
		var table = document.getElementById('table');
		for (i=0; i<fonts.length; i++) {
			row = table.insertRow(-1);
			col = row.insertCell(-1);
			col.appendChild(document.createTextNode(fonts[i][0]))
			col.style.fontFamily = fonts[i][0];
			col = row.insertCell(-1).appendChild(document.createTextNode(fonts[i][1]));
			col = row.insertCell(-1).appendChild(document.createTextNode(fonts[i][2]));
			col = row.insertCell(-1);
			fonts[i][3] ? col.className = "green" : col.className = "red";
			col.appendChild(document.createTextNode(fonts[i][3]));
		}
	}
	function sortResults() {
		for (i=0; i<fonts.length-1; i++) {
			for (j=i; j<fonts.length; j++) {
				if(fonts[i][1] < fonts[j][1]) {
					t = fonts[i];
					fonts[i] = fonts[j];
					fonts[j] = t;
				}
			}
		}
	}
Event.observe(window, 'load', init);
// ]]&gt;</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalit.org/lab/javascript-css-font-detect/feed</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
	</channel>
</rss>
