<?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>greenideas &#187; web standards</title>
	<atom:link href="http://mwhenry.com/blog/tag/web-standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://mwhenry.com/blog</link>
	<description>A blog by Matt Henry</description>
	<lastBuildDate>Fri, 02 Jul 2010 23:26:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Font-face Support Table</title>
		<link>http://mwhenry.com/blog/2009/12/font-face-support-table/</link>
		<comments>http://mwhenry.com/blog/2009/12/font-face-support-table/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 19:26:08 +0000</pubDate>
		<dc:creator>Matt Henry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[typography]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[webfonts]]></category>

		<guid isPermaLink="false">http://mwhenry.com/blog/?p=84</guid>
		<description><![CDATA[I’ve been sitting on this for a little while, so I thought I’d just go ahead and publish it. For an in-depth explanation of how I got these results, check out this post. In a nutshell, it shows that all of the main desktop browsers support some kind of @font-face format, so as long as [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been sitting on this for a little while, so I thought I’d just go ahead and publish it. For an in-depth explanation of how I got these results, check out <a href="http://mwhenry.com/blog/2009/11/webfonts-and-mobile-devices/">this post.</a> In a nutshell, it shows that all of the main desktop browsers support some kind of @font-face format, so as long as you use something like the Bulletproof font-face syntax, your fonts will render in all of the the major browsers (e.g. those with &gt; 3% market share). On mobile, it’s still a Mobile Safari-only party.</p>
<table id="fontFaceSupport" class="results" cellspacing="0" width="100%">
<caption>Webfont format support by browser</caption>
<thead>
<tr class="font-types">
<th></th>
<th>Embedded Open Type (.eot)</th>
<th>TrueType (.ttf)</th>
<th>OpenType (otf)</th>
<th>Web Open Font Format (.woff)</th>
<th>SVG (.svg)</th>
</tr>
<tr>
<th colspan="6">Mobile Browsers<a href="#fontFaceSupport-note1"><sup>1</sup></a></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="6"><a href="#fontFaceSupport"><sup id="fontFaceSupport-note1">1</sup></a> I haven’t had a chance to test Mozilla’s portable offerings</td>
</tr>
</tfoot>
<tbody>
<tr>
<th>Mobile IE (≤ WinMo 6.5)</th>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
<tr>
<th>Opera Mini (≤ v4.2)</th>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
<tr>
<th>Opera Mobile (9.7 Beta WinMo)</th>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
<tr>
<th>Palm WebOS </th>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
<tr>
<th>Mobile Safari (3.1)</th>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes!</td>
</tr>
<tr>
<th>Android (≥ 2.2 SDK)</th>
<td class="no">No</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="6">Desktop Browsers (Incomplete. I’ll be filling this in more over time)</th>
</tr>
</thead>
<tbody>
<tr>
<th>IE (≥ 5.5)</th>
<td class="yes">Yes</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
<tr>
<th>Firefox</th>
<td class="no">No</td>
<td class="yes">Yes (≥ 3.5)</td>
<td class="yes">Yes (≥ 3.5)</td>
<td class="yes">Yes (≥ 3.6)</td>
<td class="no">No</td>
</tr>
<tr>
<th>Safari</th>
<td class="no">No</td>
<td class="yes">Yes (≥ 3.1)</td>
<td class="yes">Yes (≥ 3.1)</td>
<td class="no">No</td>
<td class="yes">Yes (≥ 3.1)</td>
</tr>
<tr>
<th>Opera</th>
<td class="no">No</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="no">No</td>
<td class="yes">Yes</td>
</tr>
<tr>
<th>Chrome</th>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes (≥ 3.0)</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://mwhenry.com/blog/2009/12/font-face-support-table/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Webfonts and Mobile Devices</title>
		<link>http://mwhenry.com/blog/2009/11/webfonts-and-mobile-devices/</link>
		<comments>http://mwhenry.com/blog/2009/11/webfonts-and-mobile-devices/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 23:32:55 +0000</pubDate>
		<dc:creator>Matt Henry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[typography]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[webfonts]]></category>

		<guid isPermaLink="false">http://mwhenry.com/blog/?p=58</guid>
		<description><![CDATA[If you pay even a little attention to emerging trends in Web Standards, you’re no doubt familiar with the explosion in interest in the CSS @font-face property. This property goes back to CSS2, and has been supported in IE as far back as 5.5, but @font-face support is being added at a rapid pace to [...]]]></description>
			<content:encoded><![CDATA[<div class="image"><img src="/blog/images/chunk.gif" alt="" /></div>
<p>If you pay even a little attention to emerging trends in Web Standards, you’re no doubt familiar with the explosion in interest in the CSS <code>@font-face</code> property. This property goes back to CSS2, and has been supported in IE as far back as 5.5, but <code>@font-face</code> support is being added at a rapid pace to other browsers, hence the recent surge of interest.</p>
<p>As someone who spends his days developing for mobile platforms, I wanted to check on how <code>@font-face</code> support was progressing in mobile browsers. Read on to see what I found out.</p>
<h3>Methodology</h3>
<p>I put together a <a href="/blog/examples/font-face-test/">test page</a> I used to check the extent of <code>@font-face</code> support.</p>
<p>I made test elements and separate font families for each font format being tested (e.g. there’s a font family called “ChunkFive SVG” that will only be applied to the <code>span#SVG</code> test element. View source on the sample page for more details). I checked for <code>@font-face</code> support with three criteria (two automated):</p>
<ol>
<li>Ask each test element what font-family it thinks it is being rendered with. This is done via the <code>window.getComputedStyle()</code> method (and why I’m sticking with testing W3C compliant browsers at the moment). If all goes well, the return value should be some variant of ChunkFive.</li>
<li>Check to see if the rendered text is wider than text rendered in the browser’s default font. For the test to pass, it has to be wider, since there are font size bugs in Mobile Safari (see below).</li>
<li>Eyeball it. In some cases, the criteria above aren’t met, so the <code>@font-face</code> implementation is incorrect, but it’s close enough to be saved with some extra TLC.</li>
</ol>
<p>I also included a test case based on <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">Paul Irish’s Bulletproof @font-face syntax</a> as a bit of a sanity check and for the sake of having a less contrived example. Lastly, I threw in samples of Cufon and sIFR text, just for comparison.</p>
<p>All that said, here’s what I came up with.</p>
<h3>Results</h3>
<h4>Mobile Safari 3.0</h4>
<p>Support for <code>@font-face</code> in Mobile Safari is currently broken in several frustrating ways:</p>
<ol>
<li>Certain formats (e.g. TTF &amp; OTF), when applied, falsely report that they have been successfully applied. That is, if you check the value of font-family from getComputedStyle() on that element, it will return the <code>@font-face value</code>, even though it doesn’t render as such. (<strong>Update 11/13:</strong> As Paul Irish correctly pointed out in the comments to this post, Opera is actually the only browser that returns the font that’s actually used when <code>getComputedStyle()</code> is called.)</li>
<li>What’s worse, is that when this situation occurs, if no fallback <code>font-family</code> is specified, the text will render with the browser’s default <code>font-family</code> (as you’d expect), but <em>it does so at less than the default font size</em>. Fortunately, if you specify a fallback value in the <code>font-family</code> declaration, it will render the fallback typeface at the correct size, so always remember to pick a degradation path for your fonts.</li>
<li>Another issue with text size arises if you use the SVG format to get around the lack of support for other formats on the iPhone. While you can indeed use SVG fonts in your font-face rules on the iPhone, text rendered in SVG fonts will render at smaller than expected sizes. So if you opt for this strategy, just plan for this consequence, and correct the font sizes accordingly.  Desktop browsers that support SVG fonts (Safari &amp; Chrome) don’t exhibit this bug, so you need to target this font-size fix to mobile browsers. You can easily handle this case with a <code>@media</code> query in your stylesheet. Users of the Bulletproof Syntax will see this bug, since it will fall through to SVG on Mobile Safari.
<div class="image alignRight"><img src="/blog/images/SVGfail.png" alt="Mobile Safari renders SVG text too small" /><span class="caption">SVG fonts on Mobile Safari render too small out of the box.</span></div>
</li>
<li>Another (possibly more academic) issue is that calling <code>getComputedStyle()</code> on text rendered with an SVG font will not return the font-family value in your <code>@font-face</code> declaration, even though it renders with that font family. This could prove troublesome if you’re using Javascript to test the success of your font rendering.</li>
</ol>
<p>So if you need to use <code>@font-face</code> on Mobile Safari today, you should be sure to include an SVG version in your <code>@font-face</code> declaration, and you should patch any text size bugs with a <code>@media</code> query. (If you’re not familiar with @media queries, you should <a href="http://www.w3.org/TR/css3-mediaqueries/">read up on them</a>.)</p>
<p>Incidentally, Opera 10 on the desktop also shows a slight variation in font-size when using SVG fonts as well. However, since it supports TrueType and OpenType formats, this shouldn’t cause any particular issues if you’re using the bulletproof syntax (that’s why it’s bulletproof, yo).</p>
<h4>Android 2.0 SDK</h4>
<p>Short and not so sweet: There is no support in the Android 2.0 SDK for any webfont format. If you’re targeting Android, use Cufon.</p>
<h4>Palm WebOS</h4>
<p>Like Android, there is currently no support whatsoever for @font-face in WebOS. Additionally, in my (not at all extensive) tests, Cufon didn’t even appear to work at all (as in no text was rendered).</p>
<h3>Summary</h3>
<p>In short, if you want your mobile site to join the Nice Web Type bandwagon, you have a little more work to do than for your desktop site. Of all of the modern WebKit-based mobile browsers, only Mobile Safari provides any kind of @font-face support. And even that support is buggy and incomplete. However, if you are aware of these limitations ahead of time (which you ought to be by this point in the post), you have a couple of tricks in your back pocket to keep things running smoothly.</p>
<h3>What’s Next?</h3>
<p>In the next little while, I’ll extend these tests to cover IE on WinMo and also do a similar write-up for <code>@font-face</code> support in desktop browsers and tabulate all of the results in a little more formal manner.</p>
<p><strong>Update:</strong> In case anyone wants to take a look under the hood of these tests without jumping through hoops in Firebug or View Source, the test code is <a href="http://github.com/greenideas/font-face-test">up on Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mwhenry.com/blog/2009/11/webfonts-and-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
