<?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; Webfonts</title>
	<atom:link href="http://www.thebrightlines.com/tag/webfonts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thebrightlines.com</link>
	<description>HTML, CSS, Javascript and more</description>
	<lastBuildDate>Tue, 17 Jan 2012 22:00:35 +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>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/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/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/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/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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

