<?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>The Bright Lines &#187; CSS</title>
	<atom:link href="http://www.thebrightlines.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thebrightlines.com</link>
	<description>HTML, CSS, Javascript and more</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:44:34 +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>CSS performance, who cares?</title>
		<link>http://www.thebrightlines.com/2010/07/28/css-performance-who-cares/</link>
		<comments>http://www.thebrightlines.com/2010/07/28/css-performance-who-cares/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 05:11:40 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=648</guid>
		<description><![CDATA[You probably didn't notice it, but the way you write CSS affects the rendering speed of the browser. Should you care about that? Most likely not, but it is possible to freeze your web page with inefficient selectors.]]></description>
			<content:encoded><![CDATA[<p>Lately I read the following text in <em>Building iPhone Apps with HTML, CSS, and JavaScript</em> (O&#8217;Reilly) on using ID&#8217;s in CSS:</p>
<blockquote cite="http://oreilly.com/catalog/9780596805784?cmp=il-orm-ofps-iphoneapps"><p>&#8220;There are differences between class and id. Class attributes should be used when you have more than one item on the page with the same class value. Conversely, id values have to be unique to a page.</p>
<p>When I first learned this, I figured I’d just always use class attributes so I wouldn’t have to worry about whether I was duping an id value. However, selecting elements by id is much faster than selecting them by class, so you can hurt your performance by overusing class selectors.&#8221;</p></blockquote>
<p>Huh? I never use ID&#8217;s in CSS selectors, but I never experienced slow rendering either. I wanted to test if it&#8217;s stupid not to use ID&#8217;s.</p>
<p>First I wanted to see if it was even able to create a CSS that was hard to parse. Google has a nice article about <a href="http://code.google.com/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors">writing efficient CSS selectors</a>, so that seemed like a good start before setting up a test. In short there are 2 things that make a fast CSS selector:</p>
<ul>
<li><strong>Make rules as specific as possible</strong><br />
This means that <code>div.content</code> is faster than <code>*</code>.<br />
You have to be especially specific with the rightmost selector, since the browser reads CSS selector from right to left.</li>
<li><strong>Avoid (large) descendant rules</strong><br />
An example of a descendant rule is <code>div.content div.column1 div.columnHeader h2</code>. Descendant rules are less efficient than rules with a single selector, like <code>h2</code>.</li>
</ul>
<h2>Test 1: setting up extremely inefficient CSS</h2>
<p>The most inefficient selector by far is <code>*</code>. Combined with large descendant rules you get extremely inefficient selectors:</p>
<pre name="code" class="css:nogutter">
* * * * * * * * * {
	background: #ff1;
}
* * * * {
	background: #ff2;
}
* * * * * * * {
	background: #ff3;
}
</pre>
<p>I created a CSS file of about 20KB in size with 3600 asterisks characters (*). I combined it with a very large HTML file (1MB) with 9000 opening HTML brackets (<). Because I only wanted to test the CSS rendering, I added the following JavaScript to be able to load the CSS file on my local computer <em>after</em> the page was loaded.</p>
<pre name="code" class="javascript:nogutter">
	<a href="javascript:loadCSS('default.css')">Load CSS</a>
	<script type="text/javascript">
		function loadCSS(url) {
			var fileref=document.createElement("link");
			fileref.setAttribute("rel", "stylesheet");
			fileref.setAttribute("type", "text/css");
			fileref.setAttribute("href", url);
			document.getElementsByTagName("head")[0].appendChild(fileref);
		}
	</script>
</pre>
<h3>Results Test 1</h3>
<table>
<thead>
<tr>
<th>Browser</th>
<th>Render time (sec)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Firefox 3.6</td>
<td>2</td>
</tr>
<tr>
<td>IE 8</td>
<td>4</td>
</tr>
<tr>
<td>IE 7</td>
<td>6</td>
</tr>
<tr>
<td>IE 6</td>
<td>11</td>
</tr>
<tr>
<td>Chrome 6</td>
<td>4</td>
</tr>
</tbody>
</table>
<p><em>All tests were done on my computer (Vista with Intel Duo Core @ 2.4GHz) except for IE7 and IE6. IE7 was tested on a Vista machine with Intel Core Duo SPU @ 2.67Ghz. IE6 was tested on my machine with Virtual PC and on a PC with Windows XP SP3 and a Pentium 3 CPU 3GHz.</em></p>
<p>The results show that browsers freeze for at least 2 seconds in order to render the CSS. So it <em>is</em> possible to screw up your rendering, but you really have to make an effort for it with large HTML files and unrealistic CSS selectors.</p>
<h2>Test 2: setting up a more realistic scenario</h2>
<p>In this test I created a more realistic scenario. I took an existing CSS file and altered it until it was 113KB in size and contained about 1050 selectors. I changed the CSS rules until the bulk of the code looked like this:</p>
<pre name="code" class="css:nogutter">
.Homepage .containerText {
	position: relative;
	margin: 15px auto 0px auto;
	width: 960px;
	background:#ffffff;
}
.Homepage .containerText .containerLeft {
	float:left;
	width:450px;
	padding:10px 20px 45px 10px;
}
.Homepage .containerText .containerLeft p {
	margin:0px 0px 5px 0px;
	color:#414a49;
	line-height:1.286em;
}
</pre>
<p>So most of the code in the CSS file consisted of descendant selectors with classes and hardly any tag names. The corresponding HTML page was also created from existing code and copy-pasted until the file was 107KB in size with almost 600 opening HTML brackets (<). Now we have a relatively large HTML and CSS, but not unrealistic. Once again I tested it in different browsers:</p>
<h3>Results Test 2</h3>
<table>
<thead>
<tr>
<th>Browser</th>
<th>Render time (sec)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Firefox 3.6</td>
<td>0</td>
</tr>
<tr>
<td>IE 8</td>
<td>0</td>
</tr>
<tr>
<td>IE 7</td>
<td>0.5</td>
</tr>
<tr>
<td>IE 6</td>
<td>1.5</td>
</tr>
<tr>
<td>Chrome 6</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>All modern browsers responded so fast that I couldn&#8217;t really notice it needed rendering time. This means that the CSS file does not need any optimization by utilizing ID&#8217;s. The only browser that could profit from more efficient CSS selectors is IE 6. But since I don&#8217;t have to support IE 6 anymore, it&#8217;s not worth my time.</p>
<h2>Conclusion</h2>
<p>Writing fast CSS certainly will help some browsers on slow PC&#8217;s. But that is a minority of the users. So unless you have special requirements for your website, you&#8217;ll be better off focusing on writing logical, maintainable code than trying to get the browser to render a few milliseconds faster. There are some considerations though:</p>
<h3>Being more specific</h3>
<p>A few years ago I switched from writing <code>.foo</code> to writing <code>a.foo</code>. Adding the tag name in the selector gives me a better idea <em>what</em> I&#8217;m styling. Now I know that this coding style is also faster in rendering.</p>
<h3>Descendant selectors</h3>
<p>Descendent selectors (using more than one element in a CSS rule) are inefficient in rendering, but I won&#8217;t give that up. I like to be specific about what element I want to select in CSS. I rather write <code>div.column1 div.article span.date</code> than <code>span.date</code>. The latter is more efficient, but that only works with very small websites because only then you&#8217;d still have an overview of the all classes that are in the HTML code.</p>
<p>When I write JavaScript code I try not to &#8216;pollute&#8217; the global namespace. I try to do the same with CSS by using descendent selectors.</p>
<p>If you need faster rendering, you could alter descendant selectors by making one class that incorporates the whole path. So you&#8217;ll get <code>span.column1_article_date</code> instead of <code>div.column1 div.article span.date</code>. Although it would render faster, it also has some drawbacks. Renaming a class afterwards is tedious work, the class names can become very long and the classes can be used <em>outside</em> it&#8217;s intended containers, so a class called <code>div.column1_article_date</code> could be used anywhere in the DOM and not just inside div with the class <code>column1</code>.</p>
<h2>ID&#8217;s and JavaScript</h2>
<p>I do use ID&#8217;s by the way, Not in CSS though, but for JavaScript for these reasons:</p>
<ul>
<li>Specific elements can be easily accessed in plain JavaScript with <code>getElementById</code>.</li>
<li>If an element has an ID, I can be pretty surre that there is a bit of JavaScript attached to it.</li>
<li>Using ID&#8217;s in your jQuery selectors makes the selectors less dependent on the current HTML structure. It&#8217;s easy to break existing jQuery selectors by removing a class in the DOM.</li>
</ul>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/07/28/css-performance-who-cares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeview, a new template for JSDoc Toolkit</title>
		<link>http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/</link>
		<comments>http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:18:29 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[codeview]]></category>
		<category><![CDATA[jsdoc]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=605</guid>
		<description><![CDATA[I created a new HTML template for the Javascript documentation tool JSDoc, which is now free for download. It is tested in IE6 to IE9, FF3.6, Chrome 5 and Safari 4.]]></description>
			<content:encoded><![CDATA[<p><a class="button download" href="/article-data/downloads/codeview.zip"><span> </span>Download Codeview</a></p>
<p>The template is based on the basic template of <a href="http://code.google.com/p/jsdoc-toolkit/">JSDoc Toolkit</a>. The HTML structure is basically the same, but with a complete fresh CSS in a separate file. Nothing else is added to the template (yet), so it&#8217;s a fast loading website.</p>
<p>There are even no pictures added to the template, although it may not look that way because of the CSS3 styles that generate gradients, shadows and rounded corners. These effects are not visible in IE, except for rounded corners in IE9. So in case of IE, you&#8217;ll just see a simpler version of the website.</p>
<p>Here are some screenshots:</p>
<div class="wp-caption alignnone" style="width: 450px"><img title="Class view" src="/article-data/images/codeview-1.jpg" alt="Class view" width="440" height="413" /><p class="wp-caption-text">Class view</p></div>
<div class="wp-caption alignnone" style="width: 450px"><img title="Class overview" src="/article-data/images/codeview-2.jpg" alt="Class overview" width="440" height="413" /><p class="wp-caption-text">Class overview</p></div>
<div class="wp-caption alignnone" style="width: 450px"><img title="File overview" src="/article-data/images/codeview-3.jpg" alt="File overview" width="440" height="413" /><p class="wp-caption-text">File overview</p></div>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/03/28/document-your-javascript-interview-with-michael-mathews-of-jsdoc/' rel='bookmark' title='Permanent Link: Document your Javascript: interview with Michael Mathews of JSDoc Toolkit'>Document your Javascript: interview with Michael Mathews of JSDoc Toolkit</a></li>
<li><a href='http://www.thebrightlines.com/2010/01/07/do-you-create-your-design-in-photoshop-or-notepad/' rel='bookmark' title='Permanent Link: Do you create your design in Photoshop or Notepad?'>Do you create your design in Photoshop or Notepad?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Taking back the control</title>
		<link>http://www.thebrightlines.com/2010/03/15/taking-back-the-control/</link>
		<comments>http://www.thebrightlines.com/2010/03/15/taking-back-the-control/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 20:04:41 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web development in general]]></category>
		<category><![CDATA[cooliris]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[readability]]></category>
		<category><![CDATA[stylish]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=506</guid>
		<description><![CDATA[As a user, you have more control than you think over what your browser does with websites.]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 225px"><img title="The Bright Lines, seen through readability" src="/article-data/images/readability.png" alt="The Bright Lines, seen through readability" width="215" height="198" /><p class="wp-caption-text">The Bright Lines, as seen through &#39;readability&#39;</p></div>
<p>Lately I came across <a href="http://lab.arc90.com/experiments/readability/">Readability</a>. It&#8217;s a bookmarklet (works only in FF, Safari and Chrome) that alters any website into a more readable one. It does so by presenting it in a book form. At a first glance I thought it as a nice  tool, but I wasn&#8217;t sure I was going to use it. Then I thought that it was a real good example that you as a user have more to say than you think.</p>
<p>We always accept the usability of the websites for what it is. If it&#8217;&#8217;s good, it&#8217;s good. If it&#8217;s bad it&#8217;s bad. But the frontend of the website is built on <em>your</em> computer, in <em>your</em> browser. You have a certain level of control over the HTML, CSS and Javascript.</p>
<p>The most common way to make a website better is by using ad blockers. Yes, some people do live of advertising, but I don&#8217;t think that means you should be obliged to see them if you don&#8217;t want to. Especially when they distract. The best thing about ad blockers is that it doesn&#8217;t require any knowledge of web development at all.</p>
<p>Another example is <a href="https://addons.mozilla.org/en-US/firefox/addon/5579">CoolIris</a> that convert image pages of popular websites like Google Images or Flickr into a 3D wall of images.</p>
<p>A more techie Firefox plugin that I use is <a href="https://addons.mozilla.org/en-US/firefox/addon/2108">Stylish</a>. I use it to add my own CSS to websites I regularly visit. Most of the time I use it to remove section that I regard useless with a simple <code>display: none</code>. A more powerful variation of Stylish is the plugin <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a>. With Greasemonkey you can alter the websites with Javascript. And just like Stylish, you can publish your customization of the website through the plugin.</p>
<p>So that&#8217;s a reminder for me to see that websites are not cast in stone. Popular websites will on the client side be hacked by a small minority of users to cater their own needs. And if a site is really in need of improvement, plugins that help non-technical users would spread like wildfire.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2009/10/29/popups-dodging-popup-blockers/' rel='bookmark' title='Permanent Link: Popups dodging popup blockers'>Popups dodging popup blockers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/03/15/taking-back-the-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack: how to enable :first-child in IE6</title>
		<link>http://www.thebrightlines.com/2010/01/31/hack-how-to-enable-first-child-in-ie6/</link>
		<comments>http://www.thebrightlines.com/2010/01/31/hack-how-to-enable-first-child-in-ie6/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 00:43:14 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[first-child]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=433</guid>
		<description><![CDATA[How to implement the CSS selector :first-child in IE6 with a little help from Javascript.]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> The pure Javascript routine is updated. It is now as fast as jQuery.</p>
<p>One of the things I most dearly miss in IE6 is the lack of support for the CSS selector <code>:first-child</code>. Some shortcomings in browsers can be patched with Javascript. And <code>:first-child</code> is one of them for sure. If you use a Javascript library like jQuery or Prototype it&#8217;s just one line of Javascript:</p>
<pre name="code" class="xhtml:nogutter">&lt;!--[if lte IE 6]&gt;
    &lt;script type="text/javascript"&gt;
        jQuery("*:first-child").addClass("firstChild")
    &lt;/script&gt;
&lt;![endif]--&gt;</pre>
<p>If you don&#8217;t like Javascript libraries you can use this pure js-code:</p>
<pre name="code" class="xhtml:nogutter">
var tags = document.getElementsByTagName("*"); var nTags = tags.length;
for (var i=0;i<nTags;i++) {
	if (tags[i].firstChild) {
		var el=tags[i].firstChild; while ((el.nodeType!=1)&#038;&#038;(el.nextSibling)) el=el.nextSibling;
		if (el.nodeType==1) el.className += " firstChild";
	}
}
</pre>
<p>Now every first child has the class <code>firstChild</code> that can be used in CSS selectors. You'll get something like this:</p>
<pre name="code" class="css:nogutter">
ul li:first-child,
ul li.firstChild {
    font-weight: bold;
}
</pre>
<h2>The speed</h2>
<p>Throwing around classes through the whole HTML tree is not without a price. Certainly not if you keep in mind that Javascript in IE6 is much slower than in Firefox or Safari. So I tested what would happen if the Javascript would run in the homepage of amazon.com, a page with almost a 1000 tags. Here are the results:</p>
<ul>
<li><strong>Adding firstChild with jQuery:</strong>
<ul>
<li>Amazon.com homepage (1000 tags): +- <strong>215</strong>milliseconds</li>
<li>Five times the Amazon.com homepage (5000 tags): +- <strong>742</strong> milliseconds</li>
</ul>
</li>
<li>Adding firstChild with plain Javascript:
<ul>
<li>Amazon.com homepage (1000 tags): +- <strong>129</strong> milliseconds</li>
<li>Five times the Amazon.com homepage (5000 tags): +- <strong>798</strong> milliseconds</li>
</ul>
</li>
</ul>
<p>As you can see there is not much performance difference. Especially when you keep in mind that every time I ran my test page I got different results. With a page of 5000 tags it could run as fast as 481 milliseconds or as slow as 931.</p>
<h2>Code crafting</h2>
<p>The first test I did with the pure Javascript code gave different results because of a inefficient routine. It ran about 1/3 slower in the 1000-tag page and 4 times slower in a 5000-tag page. After consulting a colleague I was able to find a more efficient routine that could match with jQuery.</p>
<h2>Conclusion</h2>
<p>I think a lag of about 200 milliseconds during a page load with a 1000 tags can be acceptable. Especially since a web page of 1000 tags is already a large website to my standards. Most websites I develop have about 300 tags a page at best. If you want to use this hack, I guess it's best to test the script in the largest pages of the website. The gain isn't that spectacular: just support for :first-child. But on the other side it could really make your life as a web developer just a bit easier.</p>
<p>You might be tempted to patch other shortcomings of IE6 with Javascript. Don't start coding, but consider the <a href="http://code.google.com/p/ie7-js/">IE7.js-script</a>. But I must say up front that I don't have good experiences with it. The script works good in small pages with small CSS files, but you'll experience serious performance issues with medium or large websites.</p>
<h2>Putting it in perspective</h2>
<p>Chrome 4, by the way needed just 37 milliseconds to run the Javascript in the 5000-tag page. That's 20 times faster then IE6.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/01/04/alternative-for-nth-of-type-and-nth-child/' rel='bookmark' title='Permanent Link: Alternative for :nth-of-type() and :nth-child()'>Alternative for :nth-of-type() and :nth-child()</a></li>
<li><a href='http://www.thebrightlines.com/2009/10/28/for-the-sloppy-clickers/' rel='bookmark' title='Permanent Link: For the sloppy clickers'>For the sloppy clickers</a></li>
<li><a href='http://www.thebrightlines.com/2009/12/24/too-advanced-css-selectors/' rel='bookmark' title='Permanent Link: Too advanced CSS selectors'>Too advanced CSS selectors</a></li>
<li><a href='http://www.thebrightlines.com/2009/11/08/how-to-overcome-the-limits-of-css-in-internet-explorer-6/' rel='bookmark' title='Permanent Link: How to overcome the limits of CSS in Internet Explorer 6'>How to overcome the limits of CSS in Internet Explorer 6</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/31/hack-how-to-enable-first-child-in-ie6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test: Popular professional fonts as webfont</title>
		<link>http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/</link>
		<comments>http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:04:43 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Webfonts]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[fonts]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=390</guid>
		<description><![CDATA[How well do professional fonts render on the web? In this article you'll see a few examples and screenshots where the font rendering goes wrong.]]></description>
			<content:encoded><![CDATA[<h2>Why testing popular paid fonts?</h2>
<p>I wanted to know how fonts that are popular with designers would look like on the web. Can you just convert those fonts to a webfont and put it in your website? I had mixed experiences with free fonts. But hey, they&#8217;re free. Maybe the those fonts you paid a lot of money for <em>can</em> do the job.</p>
<p>When designers realize that web browsers can load any font, they will try to push the limits with trying new fonts and web developers will certainly be pressured to convert a Gill Sans or Garamond into a webfont. License or no license. Especially since they are able to create fonts that contain just a subset of the original characters. That makes it unfit for people who hope to get a professional font for free by just downloading the font file from a website.</p>
<h2>The test procedure</h2>
<p>Please don&#8217;t pin me on not having the right Helvetica or Garamond. I&#8217;m not familiar with the subtleties between different version and foundries. I converted the selected fonts with <a href="http://www.fontsquirrel.com/fontface/generator">Fontsquirrel&#8217;s fontface generator</a>. The result is viewed in the following browsers:</p>
<ul>
<li>Firefox 3.5.7 or 3.6 RC1 on Windows Vista</li>
<li>IE8 on Windows Vista</li>
<li>IE6 on Windows XP</li>
<li>Safari 3.12 on Mac OS X Leopard. Since I don&#8217;t own a Mac I used the service of <a href="http://www.browsrcamp.com/">Browsrcamp.com</a>.</li>
</ul>
<p>Fontsquirrel generates a preview text in different font sizes. I used that list of predefined font sizes as my check list. So I tested these font sizes:</p>
<p><strong>9 10 11 12 13 14 15 16 17 18 21 24 30 36 48 60 72</strong></p>
<p>As you see there are enough other font sizes that might work as webfont. This test is not intended to be absolute and complete. I want to see how professional fonts behave as webfonts and what the typical font render problems are in browsers.</p>
<h2>Helvetica</h2>
<p>Definitely an all-time favorite. Apple computers have a Helvetica installed by default, but Windows does not. The Helvetica that I used for this test renders reasonably. Check out the screenshots for <a href="/article-data/images/webfont-pop-helvetica-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-helvetica-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-helvetica-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-helvetica-Safari.png">Safari</a>. I also have the screenshots of the <em>italic</em> fonts for <a href="/article-data/images/webfont-pop-helvetica-Firefox-italic.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-helvetica-IE8-italic.png">IE8</a>, <a href="/article-data/images/webfont-pop-helvetica-IE6-italic.png">IE6</a> and <a href="/article-data/images/webfont-pop-helvetica-Safari-italic.png">Safari</a>. There are enough rendering glitches, though:</p>
<div class="wp-caption alignnone" style="width: 412px"><img title="Some letters are combined in Firefox at font size 11px" src="/article-data/images/webfont-pop-helvetica1.png" alt="Some letters are combined in Firefox at font size 11px" width="402" height="52" /><p class="wp-caption-text">Some chracters are combined in Firefox (Windows Vista) at 11px.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="The kerning is of in IE8, Vista at 15px" src="/article-data/images/webfont-pop-helvetica2.png" alt="The kerning is of in IE8, Vista at 15px" width="366" height="52" /><p class="wp-caption-text">The kerning of the &#39;e&#39; is off in IE8, Vista at 15px.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="Some letters seem to have a cap at various font sizes in IE8 Vista" src="/article-data/images/webfont-pop-helvetica3.png" alt="Some letters seem to have a cap at various font sizes in IE8 Vista" width="366" height="52" /><p class="wp-caption-text">Some characters seem to have a cap at font sizes 14, 16 and 18px in IE8 Vista.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="Another kerning problem: the top is cut off in IE8 at smaller font sizes" src="/article-data/images/webfont-pop-helvetica4.png" alt="Another kerning problem: the top is cut off in IE8 at smaller font sizes" width="366" height="52" /><p class="wp-caption-text">Another kerning problem: the top is cut off in IE8 at smaller font sizes.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="IE6 on XP SP3 is doing OK except with vertical lines in smaller font sizes" src="/article-data/images/webfont-pop-helvetica5.png" alt="IE6 on XP SP3 is doing OK except with vertical lines in smaller font sizes" width="366" height="52" /><p class="wp-caption-text">IE6 on XP SP3 is doing better than IE8 Vista, but vertical lines are over-emphesized at smaller font sizes and the text is very grey.</p></div>
<p>Looking in all four browsers, we get this list of usable and unusable font sizes.<br />
<span style="color: #008000;"><span style="color: #ff0000;">9 10 11 12</span> <strong>13</strong> <span style="color: #ff0000;">14 15 16</span> <strong>17</strong> <span style="color: #ff0000;">18 21</span> <span style="color: #008000;"><strong>24 30 36 48 60 72</strong></span></span></p>
<h2>Garamond</h2>
<p>Screenshots of Garamond in <a href="/article-data/images/webfont-pop-garamond-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-garamond-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-garamond-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-garamond-Safari.png">Safari</a>.</p>
<p>There were lots of Garamonds to choose from. Don&#8217;t pin me down on not having the right Garamond of the right vendor. The errors that I encountered here are of more importance than the difference between different Garamonds.</p>
<p>With Garamond we can clearly see the strange font rendering that can happen in Firefox It&#8217;s almost as if it tries to add some creative touch to the font and fails. Take a look at the images below. Some characters are very different from the original font design, not? These rendering oddities also occur with the type <a href="http://www.josbuivenga.demon.nl/fontinsans.html">Fontin Sans</a>, that&#8217;s used on this website. It means that I cannot use some font sizes because some characters look weird.</p>
<div class="wp-caption alignnone" style="width: 118px"><img title="Firefox PC: the letter q in different font sizes appear very different from each other" src="/article-data/images/webfont-pop-garamond-1.png" alt="Firefox PC: the letter q in different font sizes appear very different from each other" width="108" height="45" /><p class="wp-caption-text">Firefox PC: the character &#39;q&#39; in different font sizes appear very different from each other.</p></div>
<div class="wp-caption alignnone" style="width: 310px"><img title="Firefox PC at font size 13: note the odd g and the uneven distribution of space in the m" src="/article-data/images/webfont-pop-garamond-2.png" alt="Firefox PC at font size 13: note the odd g and the uneven distribution of space in the m" width="300" height="54" /><p class="wp-caption-text">Firefox PC at font size 13px: note the odd &#39;g&#39; and the uneven distribution of space in the &#39;m&#39;.</p></div>
<p>IE8 is even worse, Mostly because of bad kerning, I&#8217;d only use this font if the size is 48 pixels or larger. Look at the images below to see what IE8 does with text in large font sizes like 36px and 60px.</p>
<div class="wp-caption alignnone" style="width: 223px"><img title="Because of bad aliasing and bad kerning the e even looks bad at a font size of 36px!" src="/article-data/images/webfont-pop-garamond-3.png" alt="Because of bad aliasing and bad kerning the e even looks bad at a font size of 36px!" width="213" height="40" /><p class="wp-caption-text">IE8: Because of bad aliasing and bad kerning the &#39;e&#39; even looks bad at a font size of 36px!</p></div>
<div class="wp-caption alignnone" style="width: 132px"><img title="IE8 again: Although I think its more or less acceptable, the capital definitely needs more anti-aliasing." src="/article-data/images/webfont-pop-garamond-4.png" alt="IE8 again: Although I think its more or less acceptable, the capital definitely needs more anti-aliasing." width="122" height="62" /><p class="wp-caption-text">IE8 again: Although I think it&#39;s more or less acceptable, the capital &#39;T&#39; definitely needs more anti-aliasing at the top.</p></div>
<h3>Garamond file size</h3>
<p>My Garamond font file is very large to be a webfont by the way: 343Kb. That really asks for removing some characters. If I omit support for Greek, Coptic and Cyrillic, I can scale the file size back to 112 Kb. If I choose to only support Basic Latin, Latin-1 Sup, Currency  Symbols and Punctuation, I end up with a file size of 82 Kb. Then you&#8217;ll have just one font style of the font family. If you want to have text in Italic, you have to double the file size.</p>
<h3>Garamond font size</h3>
<p>If you want to use a Garamond, you&#8217;ll have to use a much larger font size. That&#8217;s because the height difference between uppercase and lowercase in a Garamond is larger than the standard Arial. You need a 16px Garamond to get lowercase text that is of equal to that of a 12px Arial. In case of Helvetica it&#8217;s 13px by the way.</p>
<p>So we get this list of usable and unusable font sizes:<strong><span style="color: #339966;"><br />
</span></strong><span style="color: #ff0000;">9 10 11</span><span style="color: #ff0000;"> 12 </span><span style="color: #339966;"><span style="color: #ff0000;">13</span></span><span style="color: #339966;"><span style="color: #ff0000;"> 14</span></span><span style="color: #339966;"><span style="color: #ff0000;"> 15 16 17 18 21 24 30 36 </span></span><strong><span style="color: #339966;">48 60 72</span></strong>:</p>
<h2>Dax</h2>
<p>Screenshots of Dax in <a href="/article-data/images/webfont-pop-dax-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-dax-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-dax-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-dax-Safari.png">Safari</a>.</p>
<p>Dax is, to my surprise, doing a pretty job as a webfont. Almost no strange kerning in IE8 and almost no creative font interpretation in Firefox. For some reason are font sizes 21 and 24 bad for all characters, but other font sizes are doing well with the exception of a few characters.</p>
<div class="wp-caption alignnone" style="width: 101px"><img title="Firefox 3.6 PC: FF and IE8 both have trouble with the staircase in the e at various font sizes." src="/article-data/images/webfont-pop-dax-1.png" alt="Firefox 3.6 PC: FF and IE8 both have trouble with the staircase in the e at various font sizes." width="91" height="56" /><p class="wp-caption-text">Firefox 3.6 PC: FF and IE8 both have trouble with the diagonal line in the &#39;e&#39;. At various sizes it looks like a staircase.</p></div>
<div class="wp-caption alignnone" style="width: 122px"><img title="Firefox 3.6 PC: Both IE8 and FF have trouble with all characters at font size 21 and 24" src="/article-data/images/webfont-pop-dax-2.png" alt="Firefox 3.6 PC: Both IE8 and FF have trouble with all characters at font size 21 and 24" width="112" height="26" /><p class="wp-caption-text">Firefox 3.6 PC: Both IE8 and FF have trouble font size 21 and 24. Note that the lines do not always have the same thickness.</p></div>
<p>So we get this list of usable and unusable font sizes:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 10</span><strong> 11 12 13 14 15 16 17 18 </strong><span style="color: #ff0000;">21 24</span><strong> 30 36 </strong><span style="color: #ff0000;">48</span><strong><strong> 60 72</strong></strong></span></p>
<h2>Gill Sans</h2>
<p>Screenshots of Gill Sans Regular in <a href="/article-data/images/webfont-pop-gillSans-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-gillSans-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-gillSans-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-gillSans-Safari.png">Safari</a>.<br />
Screenshots of Gill Sans Bold in <a href="/article-data/images/webfont-pop-gillSansBold-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-gillSansBold-IE8.png">IE8</a>,  <a href="/article-data/images/webfont-pop-gillSansBold-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-gillSansBold-Safari.png">Safari</a>.</p>
<p>Gill Sans Regular looks relatively nice. There are enough font sizes to choose from. Let&#8217;s focus on some rendering issues:</p>
<div class="wp-caption alignnone" style="width: 225px"><img title="Another example of the creativity of Firefox. You see some text in font size 16 and 17. Note the o and e on the top line that look like flat ellipsis." src="/article-data/images/webfont-pop-gillSans-1.png" alt="Another example of the creativity of Firefox. You see some text in font size 16 and 17. Note the o and e on the top line that look like flat ellipsis." width="215" height="52" /><p class="wp-caption-text">Another example of the &#39;creativity&#39; of Firefox. You see some text in font size 16 and 17. Note the &#39;o&#39; and &#39;e&#39; on the top line that look like flat ellipsis instead of perfect circles.</p></div>
<div class="wp-caption alignnone" style="width: 165px"><img title="IE8 Vista: Font size 14 looks nice. Except the captital T" src="/article-data/images/webfont-pop-gillSans-2.png" alt="IE8 Vista: Font size 14 looks nice. Except the captital T" width="155" height="33" /><p class="wp-caption-text">IE8 Vista: Font size 14 looks nice. Except the captital &#39;T&#39;, which is too thick.</p></div>
<div class="wp-caption alignnone" style="width: 312px"><img title="IE6 on XP SP3: IE6 does too much anti-aliasing, so that fonts at small sizes become almost a grey blur. Using a bold type can really make a difference." src="/article-data/images/webfont-pop-gillSans-3.png" alt="IE6 on XP SP3: IE6 does too much anti-aliasing, so that fonts at small sizes become almost a grey blur. Using a bold type can really make a difference." width="302" height="42" /><p class="wp-caption-text">IE6 on XP SP3 does too much anti-aliasing, so that text in small sizes become almost a grey blur. Using a bold style can really make a difference.</p></div>
<p>Usable and unusable font sizes for Gill Sans Regular:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 </span><span style="color: #339966;"><span style="color: #ff0000;">10 11 12</span></span><strong><span style="color: #339966;"> 13 </span></strong><span style="color: #ff0000;">14</span><strong><span style="color: #339966;"> 15 16 </span></strong><span style="color: #ff0000;">1<span style="color: #ff0000;">7</span></span><span style="color: #ff0000;"> 18 </span><span style="color: #ff0000;"><span style="color: #ff0000;">2</span>1</span><strong><span style="color: #339966;"> 24 </span></strong><span style="color: #ff0000;">30</span><strong><span style="color: #339966;"> </span></strong><span style="color: #339966;"><span style="color: #ff0000;">36</span></span><strong><span style="color: #339966;"> 48</span></strong><strong><strong><span style="color: #339966;"> 60 7</span>2</strong></strong></span></p>
<p>Usable and unusable font sizes for Gill Sans Bold:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #339966;"><span style="color: #ff0000;">9 10 11 12 13 14</span></span><strong><span style="color: #339966;"> 15 16 17 </span></strong><span style="color: #ff0000;">18</span><strong><span style="color: #339966;"> 21 24 30 36 48 60 72</span></strong></span></p>
<h2>Bodoni</h2>
<p>Screenshots of Bodoni Book in <a href="/article-data/images/webfont-pop-bodoni-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-bodoni-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-bodoni-IE6.png">IE6</a>.<br />
Screenshots of Bodoni Book Italic in <a href="/article-data/images/webfont-pop-bodoni-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-bodoni-IE8.png">IE8</a>,   <a href="/article-data/images/webfont-pop-bodoni-IE6.png">IE6</a>.</p>
<div class="wp-caption alignnone" style="width: 214px"><img title="IE8: Even at large sizes the small lines tend to be troublesome. Note the broken lines in the o, e, p and s." src="/article-data/images/webfont-pop-bodoni-1.png" alt="IE8: Even at large sizes the small lines tend to be troublesome. Note the broken lines in the o, e, p and s." width="204" height="52" /><p class="wp-caption-text">IE8: Even at large sizes the small lines tend to be troublesome. Note the broken lines in the &#39;o&#39;, &#39;e&#39;, &#39;p&#39; and &#39;s&#39;.</p></div>
<div class="wp-caption alignnone" style="width: 173px"><img title="The grey blur of IE6" src="/article-data/images/webfont-pop-bodoni-2.png" alt="The grey blur of IE6" width="163" height="35" /><p class="wp-caption-text">The grey blur of IE6</p></div>
<p>Bodoni renders badly. As I expected. The thin lines in serif fonts prove to be troublesome in webfonts. This is mostly due to the anti-aliasing of IE8 that is way too sharp. The italic font style has a even worse legibility.</p>
<p>Usable and unusable font sizes for Bodoni Book:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 10 11 12</span><span style="color: #339966;"><span style="color: #ff0000;"> 13 14</span><strong> </strong><span style="color: #ff0000;">15 </span><span style="color: #ff0000;">16</span><strong> </strong><span style="color: #ff0000;">17</span><strong> </strong><span style="color: #ff0000;">18</span><span style="color: #ff0000;"> 21 24 30 36</span><strong> 48</strong></span><strong><strong><span style="color: #339966;"> 60 7</span>2</strong></strong></span></p>
<p>Usable and unusable font sizes for Bodoni Book Italic:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 10 11 12 13 14</span><span style="color: #339966;"><span style="color: #ff0000;"> 15 16 17 18</span><span style="color: #ff0000;"> 21 24</span><span style="color: #ff0000;"> 30  36</span><strong> 48 60 72</strong></span></span></p>
<h2>Conclusion</h2>
<p>Phew! that&#8217;s a lot of data. So what does it all mean? Well, for starters we now know for sure that you have to check your font in different browsers and eliminate the font sizes that render badly before you start to design. This and other tests seem to show that it&#8217;s best to only use simple, sans-serif fonts. That&#8217;s because variation in thickness and diagonal lines prove troublesome in webfonts. Especially in IE8 on Vista because it&#8217;s very sharp anti-alias. It&#8217;s so sharp that the fonts look jagged.</p>
<p>Fonts in Firefox don&#8217;t look jagged and look great in very large sizes. The trouble is the &#8216;creativity&#8217; in the rendering. Characters can be wider, smaller, higher or lower than intended. In some cases it can change the complete look of a font.</p>
<p>The anti-alias in IE6 on Windows XP SP3 is in most cases way to strong. Most black text is printed grey at smaller sizes. But in some cases the vertical lines of characters exactly fit in one pixel, which results in a pure black line in a grey text. Not good.</p>
<p>And Safari? You haven&#8217;t seen me talking about Safari. That&#8217;s because the font rendering in OSX is all you could wish for. That doesn&#8217;t mean I have seen some rendering issues, but they are of a complete other order and are insignificant compared with the troublesome rendering on Windows. Font rendering in the PC version of Safari is by the way just as bad as IE, if not worse.</p>
<p>I recently tried Typekit and seen webfonts on Ascenderfonts. The selected fonts look most of the time way better than you can do yourself. So I guess that webfont services is logical option, from both legally and legibility standpoint.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/' rel='bookmark' title='Permanent Link: Webfont pitfalls'>Webfont pitfalls</a></li>
<li><a href='http://www.thebrightlines.com/2009/12/10/251/' rel='bookmark' title='Permanent Link: My favorite for converting fonts to EOT'>My favorite for converting fonts to EOT</a></li>
<li><a href='http://www.thebrightlines.com/2010/03/18/font-rendering-in-ie9/' rel='bookmark' title='Permanent Link: Web font rendering in IE9'>Web font rendering in IE9</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Webfont pitfalls</title>
		<link>http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/</link>
		<comments>http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 22:30:28 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Webfonts]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[fonts]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=370</guid>
		<description><![CDATA[After implementing webfonts in two websites it's time to document the errors one can make. This article shouldn't scare you though, it should be a timesaver.]]></description>
			<content:encoded><![CDATA[<h2>Selecting a font</h2>
<p>One of the first pitfalls you can fall into when using webfonts is that you find fonts that seems nice but aren&#8217;t usable. That could be for a number of reasons:</p>
<ul>
<li><strong>Huge line heights:</strong> Some (free) fonts have lots of space above and below the type. You have to give the text something like <code>line-height: 0.8em</code> to make it look good. But users with Chrome or old browsers will not see your website. Instead they will see lines of text in Arial on top of eachother.</li>
<li><strong>Legibility:</strong> Many fonts are only useful as a heading. That&#8217;s because font rendering on Windows is far from perfect. Especially at small font sizes. If your font isn&#8217;t readable at 11px, think twice if you want it for your body text. Please keep in mind that fonts in IE are even less legible.</li>
<li><strong>Don&#8217;t trust Photoshop:</strong> Photoshop cannot emulate the bad aliasing that can occur in browsers, so don&#8217;t comfort yourself when everything looks fine in Photoshop.</li>
<li><strong>Test in browsers:</strong> Pick the fonts you want to use and test it in different browsers. I like the free font-face service of Fontsquirrel because it not only converts the fonts to webfont format, but it also generates an HTML-file with the webfont in different sizes. Just open the page in various browsers and compare. You can check which font sizes have a good legibility. Be sure to check IE and Safari on PC because they are the worst when it comes to font rendering.</li>
<li><strong> Be wary of free fonts:</strong> I use free fonts, but you really have to pick the right ones. Some have for example problems with legibility.</li>
<li><strong>Be wary of commercial fonts as well:</strong> Users can download your fonts. So if  you use a $200 dollar font, you make it freely available. In theory you could make a new font with just a subset of the original. That would make it less desirable to download, but also less usable and it&#8217;s still not legal at all.</li>
</ul>
<h2>Conversion options</h2>
<p>Fontsquirrel has some options when converting fonts to EOT, the only font type that IE supports.</p>
<ul>
<li><strong>Hints:</strong> Hints help the anti-aliasing engine with it&#8217;s work by giving &#8230; well, uhm &#8230; hints on how to do that. Hints tell what pixel should get which color in order to create the effect of smooth lines. If your font has bad hints or none at all, you could auto generate them when converting. It can make a difference. Hinting is done fully automatic though, so you could expect glitches like having an <em>i</em> without a dot. Those errors occur mostly at small font sizes, so if you use the font in headings it should be fine.</li>
<li><strong>Subsetting:</strong> A font can be as small as 20Kb, but also as large as 200Kb. Multiply that number with every font style you want to use like italic and bold. My weblog loads 4 font files of +- 25Kb. For IE the font files are even larger: 4 times 70 Kb. You can limit the file size by removing all the types you won&#8217;t use like Arabic or Chinese.</li>
</ul>
<h2>Setting up the font-face right</h2>
<ul>
<li><strong>The right @font-face syntax:</strong> Writing the font-face code isn&#8217;t hard to do. But what you really need to be sure of is that it works good for all browsers. After I implemented webfonts in this blog, I discovered that Firefox loaded both OTF and EOT files, although it doesn&#8217;t even support EOT! Paul Irish has a <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">nice article about the various font-face options</a> and concludes that there is only one good syntax. That&#8217;s the one below:<br />
<code>@font-face {<br />
font-family: 'Graublau Web';<br />
src: url('GraublauWeb.eot');<br />
src: local('Graublau Web Regular'), local('Graublau Web'), url('GraublauWeb.otf') format('opentype');<br />
}</code></li>
<li><strong>Cross domain webfonts:</strong> I discovered that Firefox is <a href="http://www.thebrightlines.com/2010/01/12/implementing-font-face-cross-domain/">pretty fussy when about the location of fonts</a>. This can save you an hour of frustration.</li>
</ul>
<p>Of all the errors I made, the biggest one was the idea that you can grab any font, use it in your website and be sure that it renders like you would expect in Photoshop. It just doesn&#8217;t. There aren&#8217;t much fonts that render well at 11 to 14 pixels.  This blog used the font <a href="http://www.josbuivenga.demon.nl/fontinsans.html">Fontin Sans</a> for all text. Now I scaled it down to just the logo and the major headings. All other text is “just” Tahoma/Geneva.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/' rel='bookmark' title='Permanent Link: Test: Popular professional fonts as webfont'>Test: Popular professional fonts as webfont</a></li>
<li><a href='http://www.thebrightlines.com/2009/12/10/251/' rel='bookmark' title='Permanent Link: My favorite for converting fonts to EOT'>My favorite for converting fonts to EOT</a></li>
<li><a href='http://www.thebrightlines.com/2009/11/01/the-trouble-with-font-face/' rel='bookmark' title='Permanent Link: The trouble with @font-face'>The trouble with @font-face</a></li>
<li><a href='http://www.thebrightlines.com/2010/02/28/web-fonts-services-list/' rel='bookmark' title='Permanent Link: List of web fonts services and resources'>List of web fonts services and resources</a></li>
<li><a href='http://www.thebrightlines.com/2009/11/07/no-sign-of-font-face-in-chrome-4/' rel='bookmark' title='Permanent Link: No sign of @font-face in Chrome 4'>No sign of @font-face in Chrome 4</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Implementing font-face cross domain</title>
		<link>http://www.thebrightlines.com/2010/01/12/implementing-font-face-cross-domain/</link>
		<comments>http://www.thebrightlines.com/2010/01/12/implementing-font-face-cross-domain/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 21:13:59 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Webfonts]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[EOT]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=363</guid>
		<description><![CDATA[Firefox is fussy about fonts residing on other domains.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still in the middle of a redesign of my <a href="http://electricspace.blogspot.com/">personal weblog</a>, but I&#8217;m glad I got the font-face working. It was a hard nut to crack. The source of all the trouble was that Firefox would load font files from other domains. Although the domain restriction isn&#8217;t making things easier, it is sort of sensible.</p>
<p>Internet Explorer is the only browser that supports EOT, a font format that has digital rights management. That way you can make sure that your $200 font isn&#8217;t downloaded and used by everybody on the internet.</p>
<p>But like I said: IE is the only browser that can understand that file type. So Mozilla apparently implemented some sort of protection against font hijackers: It will only accept fonts from domains that specifically allow fonts to be downloaded. In case of Apache you have to add the following code below to the .htaccess file. I found it on <a href="http://openfontlibrary.org/wiki/Web_Font_linking_and_Cross-Origin_Resource_Sharing">Open Font Library</a>.</p>
<p><code>&lt;FilesMatch "\.(ttf|otf|eot)$"&gt;<br />
&lt;IfModule mod_headers.c&gt;<br />
Header set Access-Control-Allow-Origin "*"<br />
&lt;/IfModule&gt;<br />
&lt;/FilesMatch&gt;</code></p>
<p>This does not help you prevent people from stealing your font, but it will protect you from web developers who want to add the URL to the font on your domain in their font-face declaration. It&#8217;s not really a solution if you ask me. It seems more like a <em>gesture</em> to the creators of fonts.</p>
<p>It appears you could replace the asteriks with the domain of your website, but in my case (http://electricspace.blogspot.com/) did not do the job.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2009/11/01/the-trouble-with-font-face/' rel='bookmark' title='Permanent Link: The trouble with @font-face'>The trouble with @font-face</a></li>
<li><a href='http://www.thebrightlines.com/2009/11/07/no-sign-of-font-face-in-chrome-4/' rel='bookmark' title='Permanent Link: No sign of @font-face in Chrome 4'>No sign of @font-face in Chrome 4</a></li>
<li><a href='http://www.thebrightlines.com/2009/12/10/251/' rel='bookmark' title='Permanent Link: My favorite for converting fonts to EOT'>My favorite for converting fonts to EOT</a></li>
<li><a href='http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/' rel='bookmark' title='Permanent Link: Webfont pitfalls'>Webfont pitfalls</a></li>
<li><a href='http://www.thebrightlines.com/2010/03/09/new-web-font-service-ascender-corporation/' rel='bookmark' title='Permanent Link: New web font service: Ascenderfonts.com'>New web font service: Ascenderfonts.com</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/12/implementing-font-face-cross-domain/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Do you create your design in Photoshop or Notepad?</title>
		<link>http://www.thebrightlines.com/2010/01/07/do-you-create-your-design-in-photoshop-or-notepad/</link>
		<comments>http://www.thebrightlines.com/2010/01/07/do-you-create-your-design-in-photoshop-or-notepad/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 23:22:14 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=349</guid>
		<description><![CDATA[Do you show your client static pictures of the web design or do you code the mockup in HTML?]]></description>
			<content:encoded><![CDATA[<p>Recently Meagan Fisher published an <a href="http://24ways.org/2009/make-your-mockup-in-markup">article in which she discusses an alternative way to present a web design</a> to a client: Don&#8217;t emulate it in Photoshop, but build it in HTML and CSS. There are some advantages to it. A client can see more than just the design. He/she can also see:</p>
<ul>
<li>Behaviour of the fluid design</li>
<li>Interaction like hovers</li>
<li>How the website looks in different browsers</li>
</ul>
<p>On top of it, she also mentions some disadvantages of using Photoshop:</p>
<ul>
<li>It crashes, leaving you with hours of work lost.</li>
<li>Font rendering sucks</li>
</ul>
<h2>Photoshop is still king</h2>
<p>Although creating a website directly in HTML has it advantages, I think designing in Photoshop is better in most cases.</p>
<h3>Photoshop is faster</h3>
<p>Yes, a simple design could well be created directly in HTML. But not all designs are simple. Changing a background color is easy in CSS, but dragging columns around, changing or altering visuals and all kind of other alterations are quicker in Photoshop. Designs can change dramatically before it is finally approved by the client. Those changes are quicker done in Photoshop.</p>
<h3>Photoshop is static</h3>
<p>Being static isn&#8217;t not just a disadvantage. A static design is in fact helpful because it helps you focus on how a website should look like and not be bogged down by browser incompatibilities. This too gives you extra speed in designing.</p>
<h3>Photoshop is versatile</h3>
<p>Just because CSS can do stuff like round corners and text shadows in some browsers, doesn&#8217;t mean it has become a designing tool. Photoshop can do more than just that.  When designing in HTML I start to think too much in the constraints that both HTML and CSS have. In Photoshop I have much more design choices. Because of that I&#8217;m able to think more out of the box.</p>
<h2>Crashes and font rendering</h2>
<p>I was suprised that Photoshop crashes are mentioned as a major problem. I consider Photoshop as a very reliable product. The only problem is that saving can take a while, so not everyone saves regularly. If you don&#8217;t save regularly you&#8217;re asking for trouble. Even with stable products.</p>
<p>The issue with font rendering is indeed a problem, but that&#8217;s more an issue for designers. Clients don&#8217;t even know it&#8217;s an issue. They&#8217;ll only notice differences when they&#8217;re dramatic like with webfonts. Just compare this weblog between Apple Safari and IE on the PC: it&#8217;s hard <em>not</em> to see the difference.</p>
<h2>My preference</h2>
<p>Since I&#8217;m a web developer I ought to be tempted to skip Photoshop and start coding right away. But that&#8217;s not the case. I designed my blog twice last year. In both cases I chose to do the basic design in Photoshop. Only when I was happy with that basic design, I started developing and added extra elements on the fly. The current design of my blog could just as easy be built in HTML/CSS from the start, but I&#8217;m convinced it&#8217;s better to work in Photoshop first.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2009/12/26/differences-between-photoshop-web-design-and-html-part-1-line-height/' rel='bookmark' title='Permanent Link: Differences between Photoshop web design and HTML. Part 1: line height'>Differences between Photoshop web design and HTML. Part 1: line height</a></li>
<li><a href='http://www.thebrightlines.com/2009/11/05/3-tips-for-making-css-sprites-in-photoshop/' rel='bookmark' title='Permanent Link: 3 Tips for making CSS sprites in Photoshop'>3 Tips for making CSS sprites in Photoshop</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/07/do-you-create-your-design-in-photoshop-or-notepad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternative for :nth-of-type() and :nth-child()</title>
		<link>http://www.thebrightlines.com/2010/01/04/alternative-for-nth-of-type-and-nth-child/</link>
		<comments>http://www.thebrightlines.com/2010/01/04/alternative-for-nth-of-type-and-nth-child/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 21:17:14 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[nth-child]]></category>
		<category><![CDATA[nth-of-type]]></category>
		<category><![CDATA[zebra]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=334</guid>
		<description><![CDATA[Replace a CSS3 selector that's not supported in IE with a CSS2 selector that has support.]]></description>
			<content:encoded><![CDATA[<p><a class="button demo" href="/article-data/demo/nthChildAlternative.html"><span> </span>View demo</a></p>
<p>One thing I really like about jQuery is the ease by which you can select the <em>nth</em> item of a list of items like this: <code>jQuery("ul &gt; li:eq(3)")</code>. In CSS you would select an <em>nth</em> item like this: <code>ul &gt; li:nth-of-type(3)</code>. The problem is that <code>:</code><code>nth-of-type</code><code>()</code> is not supported at all in Internet Explorer. IE9 <em>will</em> support all CSS3 selectors, including <code>:</code><code>nth-of-type</code><code>()</code>, but by the time IE9 is a mature browser, Webkit and Gecko-based browsers are be able to do everything except your dishes.</p>
<p>So if you want to make an exception for, say, the third menu item, you have to either add a class to that menu item or select that item through Javascript. But if you don&#8217;t care for IE6, there&#8217;s a reasonable alternative:</p>
<p><code>ul &gt; li:</code><code>nth-of-type</code><code>(3)</code> equals <code>ul &gt; li:first-child + li + li</code>.</p>
<p>Although both selectors are different, they do select the same element. But the first is not supported in IE and the second <em>is</em>. From IE7 and up! Sure, it&#8217;s not feasible to select the 100th item in a list, but not all lists are that long. And you can always use Javascript as a fallback.</p>
<p>This alternative selection method is by the way by no means equal to <code>:</code><code>nth-of-type</code><code>()</code>. With <code>:</code><code>nth-of-type</code><code>()</code> you can make a cool <a href="http://www.alistapart.com/articles/zebratables/">zebra striping</a> without the use of Javascript.</p>
<p>And finally, as suggested in the title, there is also a way to handle <code>:nth-child</code><code>(3)</code> in an almost similar fashion:</p>
<p><code>ul &gt; li:</code><code>nth-child</code><code>(3)</code> equals <code>ul &gt; *:first-child + * + *</code>.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/01/31/hack-how-to-enable-first-child-in-ie6/' rel='bookmark' title='Permanent Link: Hack: how to enable :first-child in IE6'>Hack: how to enable :first-child in IE6</a></li>
<li><a href='http://www.thebrightlines.com/2009/12/24/too-advanced-css-selectors/' rel='bookmark' title='Permanent Link: Too advanced CSS selectors'>Too advanced CSS selectors</a></li>
<li><a href='http://www.thebrightlines.com/2009/11/08/how-to-overcome-the-limits-of-css-in-internet-explorer-6/' rel='bookmark' title='Permanent Link: How to overcome the limits of CSS in Internet Explorer 6'>How to overcome the limits of CSS in Internet Explorer 6</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/04/alternative-for-nth-of-type-and-nth-child/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog redesign</title>
		<link>http://www.thebrightlines.com/2010/01/03/blog-redesign/</link>
		<comments>http://www.thebrightlines.com/2010/01/03/blog-redesign/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 23:53:27 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Web development in general]]></category>
		<category><![CDATA[Webfonts]]></category>
		<category><![CDATA[redesign]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=320</guid>
		<description><![CDATA[The Bright Lines has a new design. A short analysis of the new design.]]></description>
			<content:encoded><![CDATA[<p>The last few days I was busy redesigning the website. I was not happy with the original design.</p>
<ul>
<li>The menu on the top right was large and clunky. Because of that it didn&#8217;t leave much room for more links.</li>
<li>The &#8216;logo&#8217; on the top left did not feel like a real logo mainly because it was &#8230; well &#8230; just not designed well.</li>
<li>The shadow effect on the columns looked cool, but because it was made with PNG8 images instead of PNG24, it wasn&#8217;t possible to add an background image to the page.</li>
</ul>
<p>What I <em>did</em> like was the scalability of the website. you could as easily view the page on your (i)phone as it would be on your large, wide computer screen. I dropped support for mobile phones. There are lots of Wordpress plugins to cater the mobile devices. I have to dive into that some time. For now anyone with a mobile device can grab the <a href="http://www.thebrightlines.com/news-feeds/">RSS feeds</a>.</p>
<p>I still have to fix a few styling glitches but I thought the design was good enough to make the switch. Here are the most important aspects of the design:</p>
<ul>
<li>Use of <code>rgba</code> as background color. This makes it possible to set opacity for just the background instead of the whole box. <code>rgba</code> is not supported in IE, so you will have a solid white background then.</li>
<li>Using opacity in the columns makes it possible to use large backgrounds. That gives me a reason to pick up my photography.</li>
<li>The use of webfonts. This was something I was eager to use. This is something designers and web developers alike have been waiting for. The implementation isn&#8217;t perfect, but it looks well in Firefox and on the Apple. IE and Webkit on the PC still need some tweaking. I&#8217;ll go in to more detail in an upcoming article. For now I&#8217;ve been glad to be able to experiment with a real web site instead of running some tests with webfonts.</li>
<li>Less data: I removed irrelevant data where I could. It&#8217;s most apparent in the list of articles on the homepage where I removed information like categories, tags and dates.</li>
<li>Links become visible with an underline when a column is <code>hover</code>ed. This will make the website look less crowded. It&#8217;s a bit like the folder tree view in Vista&#8217;s Windows Explorer: you will only see the folding icons (the plus and minus icons next to the folders) when that section is active.</li>
</ul>
<p>There are some things I have to do:</p>
<ul>
<li>Make a logo that is suitable for creating a favicon</li>
<li>Tweaking the fonts for IE &amp; Webkit on PC.</li>
</ul>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/03/blog-redesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
