<?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>Mozilla Hacks - the Web developer blog &#187; @font-face</title>
	<atom:link href="http://hacks.mozilla.org/category/font-face/feed/" rel="self" type="application/rss+xml" />
	<link>http://hacks.mozilla.org</link>
	<description>hacks.mozilla.org</description>
	<lastBuildDate>Wed, 08 Feb 2012 22:52:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Firefox 4 Demos: Awesome CSS3 Planetarium</title>
		<link>http://hacks.mozilla.org/2011/03/css3-planetarium/</link>
		<comments>http://hacks.mozilla.org/2011/03/css3-planetarium/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 16:55:09 +0000</pubDate>
		<dc:creator>Paul Rouget</dc:creator>
				<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Featured Demo]]></category>
		<category><![CDATA[Firefox 4]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=7585</guid>
		<description><![CDATA[O hai pixel lovers! Check out this gorgeous CSS3 demo: Planetarium, by the LittleWorkshop team (@glecollinet &#38; @whatthefranck). Screencast: Youtube link. Gorgeous Animations The principal feature show-cased in this demo is CSS3 Transitions. The animation between the welcome-screen and the planet-screen, and the animation between the different planets are powered by transitions. But there are [...]]]></description>
			<content:encoded><![CDATA[<p><em>O hai pixel lovers! Check out this gorgeous CSS3 demo: <a href="http://mozillademos.org/demos/planetarium/demo.html">Planetarium</a>, by the <a href="http://www.littleworkshop.fr/">LittleWorkshop</a> team (<a href="http://twitter.com/#!/glecollinet/">@glecollinet</a> &amp; <a href="http://twitter.com/#!/whatthefranck/">@whatthefranck</a>).</em></p>
<p><a href="http://mozillademos.org/demos/planetarium/demo.html"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/screenshot1.jpg" alt="planetarium" title="planetarium" class="aligncenter"></a></p>
<p><strong>Screencast:</strong><br />
<iframe type="text/html" width="500" height="360" src="http://www.youtube.com/embed/fT6amnMTrVk" frameborder="0"></iframe><br />
<em><a href="http://www.youtube.com/watch?v=fT6amnMTrVk">Youtube link</a>.</em></p>
<h2>Gorgeous Animations</h2>
<p>The principal feature show-cased in this demo is <a href="https://developer.mozilla.org/en/CSS/CSS_transitions">CSS3 Transitions</a>. The animation between the welcome-screen and the planet-screen, and the animation between the different planets are powered by transitions. But there are many little effects in this demo. Take a look at the Twitter button, the ruler, the credit page or the back button. These effects are CSS3 Transitions too.</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/side.png" title="transition effect" width="250" style="float: right; margin: 5px;" /></p>
<p>Another interesting detail. Next to the planet, you have some different animations. The way the animations is played depends on if you&#8217;re coming from the left, the right or from the home screen.</p>
<p>Try it yourself: Click on the planet Earth, from the home screen. See the text &#8220;falling&#8221; from the top? Now, go to Mars, and come back to Earth. Now the text is &#8220;flying&#8221; from the right. Designers will love that :)</p>
<h2>Beautiful fonts</h2>
<p><a href="https://developer.mozilla.org/en/css/@font-face">@font-face</a> allows you to use your own font for creative design. Combined with <a href="https://developer.mozilla.org/fr/CSS/text-shadow">text-shadow</a> and <a href="https://developer.mozilla.org/en/CSS/-moz-font-feature-settings">font-feature-settings</a>, you can accurately forge and style your typographic content.<br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/fontface1-500x222.png" alt="" title="fontface1" width="500" height="222" class="aligncenter size-large wp-image-7603" /></p>
<h2>Your turn!</h2>
<p>These are features you can use today.<br />
This demo works perfectly in Firefox 4, Safari and Chrome. Also, Transitions and font-face are easily degradable. Go. Check out <a href="https://github.com/littleworkshop/planetarium">the source code</a>, read <a href="https://developer.mozilla.org/en/CSS">the documention</a>, and if you&#8217;re proud of your code, feel free to <a href="https://developer.mozilla.org/demos/">submit a demo</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/03/css3-planetarium/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Firefox 4: OpenType font feature support</title>
		<link>http://hacks.mozilla.org/2010/11/firefox-4-font-feature-support/</link>
		<comments>http://hacks.mozilla.org/2010/11/firefox-4-font-feature-support/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 01:32:30 +0000</pubDate>
		<dc:creator>John Daggett</dc:creator>
				<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Firefox 4]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=6599</guid>
		<description><![CDATA[When @font-face support was introduced in Firefox 3.5, web authors were suddenly given a way of dramatically enhancing the typography used on their sites.  With all major browsers slated to soon support WOFF fonts offered by many font vendors, the range of fonts available on the web is far wider than it was just two [...]]]></description>
			<content:encoded><![CDATA[<p>When <a href="https://developer.mozilla.org/en/css/@font-face">@font-face</a> support was introduced in Firefox 3.5, web authors were suddenly given a way of dramatically enhancing the typography used on their sites.  With all major browsers slated to soon support WOFF fonts offered by many font vendors, the range of fonts available on the web is far wider than it was just two years ago.</p>
<p style="display: none; margin: 0; padding: 0;">
<!-- Hi Mom!  This paragraph is for hacking WordPress --><br />
<!-- Myriad Pro from Adobe via Typekit --><br />
<script type="text/javascript" src="http://use.typekit.com/xti0aim.js"></script><br />
<script type="text/javascript">try{Typekit.load();}catch(e){}</script></p>
<style type="text/css">
h4 + p { margin-top: 1em; }
#content-main { font-family: myriad-pro-1,myriad-pro-2, Helvetica,"Helvetica Neue",Arial,sans-serif; }
#content-main .post a img { border-width: 2px; } 
</style>
</p>
<p>The OpenType format has long provided font designers ways of including a rich set of variations in their fonts, from ligatures and swashes to small caps and tabular figures. The OpenType specification describes these features, identifying each with a unique feature tag but they have typically only been available to those using professional publishing applications such as Adobe InDesign. When glyphs are selected for a particular sequence of characters and positioned for rendering, these features affect both glyph selection and positioning.  Firefox currently renders using a font&#8217;s default feature settings; it would be much more interesting to provide web authors with a way of controlling these font features via CSS.</p>
<p>Included among the many new features in Firefox 4 is the next step, support for controlling OpenType font features directly via CSS.  The <a href="https://developer.mozilla.org/en/CSS/-moz-font-feature-settings">-moz-font-feature-settings CSS property</a> permits control over kerning, ligatures, alternates, real small caps and stylistic sets to name just a few.</p>
<p>The CSS3 Fonts specification contains a number of <a href="http://dev.w3.org/csswg/css3-fonts/#font-variant-ligatures-prop">new subproperties of font-variant</a>.  These will eventually provide much better author control over font features but for Firefox 4 only the low-level <a href="https://developer.mozilla.org/en/CSS/-moz-font-feature-settings">-moz-font-feature-settings CSS property</a> is supported.  With this authors can enable and disable OpenType font features directly:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.altstyles</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #808080; font-style: italic;">/* format: feature-tag=[0,1] with 0 to disable, 1 to enable */</span>
  <span style="color: #808080; font-style: italic;">/* dlig = discretionary ligatures, ss01 = stylistic set 1 */</span>
  -moz-font-feature-settings<span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;dlig=1,ss01=1&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>For reference, a complete list of registered OpenType features can be found <a href="http://www.microsoft.com/typography/otspec/featurelist.htm">here</a>. The folks at FontFont provide a <a href="http://www.fontfont.com/opentype/FF_OT_UserGuide_v2.pdf">nice visual guide to OpenType features</a>.</p>
<h4>Ligatures and Contextual Alternates</h4>
<p>Font designers often include simple ligatures and kerning data in their fonts but some go beyond these and spend a lot of time creating special ligatures and contextual alternate glyphs to enhance a given design. The <a href="http://www.underware.nl/site2/index.php?id1=bello&amp;id2=features">Bello Pro script font</a> from Underware is a brush-like design that includes many special ligatures (click image to view):</p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/sugarspice.html"><img src="http://people.mozilla.org/~jdaggett/webfonts/sugarspice.png"></a></p>
<p>Note the special ligatures for &#8220;and&#8221; and &#8220;by&#8221;, the use of all small caps and the use of alternate glyphs to enhance the script connection between the letters in &#8220;Smooching&#8221;.  Only font styling is used here, all the text can be selected and copied, there are no images used on the example page.</p>
<h4>Number styles</h4>
<p>Using <a href="http://typekit.com/fonts/minion-pro">Minion Pro from Adobe</a>, available via Typekit, the example below illustrates the use of tabular, monospaced number forms to display columns of data in a way that&#8217;s easy to read and analyze.  When proportional numbers are used, the width of large figures with the same number of digits will vary. Normally this would require using a different, monospaced font.  But with OpenType fonts that provide number formatting features, authors can use a single font without giving up the readibility of large data sets (click image to view):</p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/salestable.html"><img src="http://people.mozilla.org/~jdaggett/webfonts/salestable.png"/></a></p>
<p>Fonts may use either tabular or proportional number forms by default; providing access to these features allows authors to use both proportional figures for inline text and tabular figures for tabular data without the need to switch fonts.</p>
<h4>Automatic fractions</h4>
<p>Recipes for American dishes often use fractional amounts.  These can easily be rendered using the automatic fraction feature in OpenType (click image to view):</p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/tiramisu.html"><img src="http://people.mozilla.org/~jdaggett/webfonts/tiramisu.png"/></a></p>
<p>Each of the fractions above is written in simple text form, (e.g. 2 1/2), no special Unicode codepoints are used.  For fonts that support automatic fractions, an OpenType layout engine will automatically generate fractional forms for numbers separated by a slash.  These are typically limited to simple fractions, for more complex math expressions markup languages like <a href="https://developer.mozilla.org/en/Mathml">MathML</a> should be used instead.</p>
<h4>Language sensitivity</h4>
<p>Many languages often use a common script and over time differences in usage naturally arise.  Serbian, Macedonian and Bulgarian all use the Cyrillic script but with slightly different glyph forms for some common characters.  OpenType fonts support the ability to specify script-specific and language-specific glyph handling so given the correct lang attribute in the markup of a page, Firefox 4 can now render text in a language-specific way (click image to view):</p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/serbianglyphs.html"><img src="http://people.mozilla.org/~jdaggett/webfonts/serbianglyphs.png"/></a></p>
<h4>Arbitrary features</h4>
<p>OpenType defines font feature support using an underlying set of primitives. This allows font designers the ability to create their own features, either for a specialized purpose or as a general feature to be included in a future version of the OpenType specification.  Since the syntax of -moz-font-feature-settings allows for the use of arbitrary feature tags, these can be accessed via CSS.</p>
<p>In the example below, font designer Erik van Blokland of <a href="http://letterror.com/">LettError</a> uses a custom designed set of feature properties to create an interesting animation effect when hovering over text on the page (click image to view):</p>
<p><a href="http://letterror.com/develop/css3/kosmik/"><img src="http://people.mozilla.org/~jdaggett/webfonts/images/ticklemekosmik.png"/></a></p>
<h4>HarfBuzz, an OpenType shaping engine</h4>
<p>The process of selecting and positioning glyphs used to display text runs has in the past always been done via platform libraries such as Uniscribe on Windows and CoreText on  OSX.  To assure more robust and consistent text rendering across platforms, Firefox 4 will use the open source <a href="http://www.freedesktop.org/wiki/Software/HarfBuzz">HarfBuzz OpenType shaping engine</a> on all platforms. In the future this will allow us to integrate support for complex Indic and Southeast Asian scripts that have often been ignored or supported inconsistently in the past.</p>
<h4>A Note About Typekit Use</h4>
<p>All of the Adobe fonts available via the Typekit webfont service provide access to the full range of OpenType features found in the original fonts.  But to access those features you&#8217;ll need to explicitly enable &#8220;All Characters&#8221; under the &#8220;Language Support&#8221; category in the kit editor dialog before publishing.</p>
<h4>Other examples</h4>
<p>(Updated from a <a href="http://hacks.mozilla.org/2009/10/font-control-for-designers/">blog post last year</a>):</p>
<ul>
<li><a href="http://people.mozilla.com/~jkew/feature-samples/MEgalopolis.html">Use of contextual alternates and ornaments</a>
<li><a href="http://people.mozilla.com/~jkew/feature-samples/cooking.html">Another recipe example</a>
<li><a href="http://people.mozilla.com/~jkew/feature-samples/forex.html">Tabular data example</a>
<li><a href="http://people.mozilla.com/~jkew/feature-samples/udhr-turkish.html">Language specific rendering of Turkish</a>
<li><a href="http://people.mozilla.org/~jdaggett/webfonts/historicaltext.html">Rendering historical text</a>
</ul>
<p><em>Update: the content of the examples is now editable!  Edit the text of each example to experiment with the different font features.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/11/firefox-4-font-feature-support/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>font_dragr: a drag and drop preview tool for fonts</title>
		<link>http://hacks.mozilla.org/2009/10/font_dragr-a-drag-and-drop-preview-tool-for-fonts/</link>
		<comments>http://hacks.mozilla.org/2009/10/font_dragr-a-drag-and-drop-preview-tool-for-fonts/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 17:00:22 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[@font-face]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Drag and Drop]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[Firefox 3.6]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=2086</guid>
		<description><![CDATA[This demo is from our good friend Ryan Seddon who came up with a demo that seems deeply appropriate for this week, given our focus on the future of fonts on the web. If you&#8217;ve ever been editing a page and wanted to know what a particular font looked like without having to upload files [...]]]></description>
			<content:encoded><![CDATA[<p>This demo is from our good friend <a href="http://twitter.com/thecssninja">Ryan Seddon</a> who came up with a demo that seems deeply appropriate for this week, given our focus on the <a href="http://hacks.mozilla.org/2009/10/font-control-for-designers/ ">future</a> of <a href="http://hacks.mozilla.org/2009/10/woff/">fonts on the web</a>.</p>
<p>If you&#8217;ve ever been editing a page and wanted to know what a particular font looked like without having to upload files to a web server and update CSS (so tedious, that!) then this demo is for you.</p>
<p>He&#8217;s come up with a demo that shows what&#8217;s possible when you&#8217;ve got downloadable fonts, drag and drop and editable content.  (If you want to know more about drag and drop we suggest you read his excellent overview of using <a href="http://www.thecssninja.com/javascript/drag-and-drop-upload">drag and drop to do file uploading</a>.)</p>
<p>From <a href="http://www.thecssninja.com/javascript/font-dragr">Ryan&#8217;s description</a>:</p>
<blockquote><p><a href="http://labs.thecssninja.com/font_dragr/">Font dragr</a> is an experimental web app that uses HTML5 &amp; CSS3 to create a useful standalone web based application for testing custom fonts, once you visit it for the first time you don’t need to be online to use it after the initial visit. It allows you, in Firefox 3.6+, to drag and drop font files from your file system into the drop area. The browser will then create a data URL encoded copy to use in the page and render the content in the dropped font.</p></blockquote>
<p>You can either <a href="http://www.thecssninja.com/javascript/font-dragr">read the full description</a>, which contains a lot of useful technical information about how the demo works, or you can <a href="http://labs.thecssninja.com/font_dragr/">view the demo</a> below.  Either way, it&#8217;s nice to see the excellent HTML5 support in Firefox 3.6 coming together with everything else we&#8217;ve added to bring a lot of new capabilities to web developers and users.</p>
<p>Thanks, Ryan!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="i=20449" /><param name="allowFullScreen" value="true" /><param name="src" value="http://screenr.com/Content/assets/screenr_0817090731.swf" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="300" src="http://screenr.com/Content/assets/screenr_0817090731.swf" allowfullscreen="true" flashvars="i=20449"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/10/font_dragr-a-drag-and-drop-preview-tool-for-fonts/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>after Firefox 3.6 &#8211; new font control features for designers</title>
		<link>http://hacks.mozilla.org/2009/10/font-control-for-designers/</link>
		<comments>http://hacks.mozilla.org/2009/10/font-control-for-designers/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 16:00:21 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[@font-face]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured Demo]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=1984</guid>
		<description><![CDATA[Note: the discussion below applies to work in progress that might show up in Firefox 3.7. It does not describe features in Firefox 3.6. This post is from Jonathan Kew and John Daggett. He&#8217;s supplied a 5 minute video that shows some of the features on the fly. If you&#8217;re a total font nerd and [...]]]></description>
			<content:encoded><![CDATA[<p><i>Note: the discussion below applies to work in progress that <em>might</em> show up in Firefox 3.7.  It does not describe features in Firefox 3.6.</i></p>
<p><i>This post is from Jonathan Kew and John Daggett.  He&#8217;s supplied a 5 minute video that shows some of the features on the fly.  If you&#8217;re a total font nerd and you enjoy a soothing British accent, you might want to watch it.</i></p>
<p><video controls="true"><source type="video/ogg" src="http://videos.mozilla.org/serv/blizzard/woff/features-screencast-500.ogv"/><source type="video/mp4" src="http://videos.mozilla.org/serv/blizzard/woff/features-screencast-500.mp4"/><embed src="http://blip.tv/play/AYGoj0QC" type="application/x-shockwave-flash" width="500" height="416" allowscriptaccess="always" allowfullscreen="true"></embed></video></p>
<p>Using @font-face allows web designers a wide palette of font choices and with commercial font vendors supporting the <a href="http://hacks.mozilla.org/2009/10/woff/">WOFF</a> font format, the set of font choices should improve even more. So the next step is clearly to try and make better use of features available in these fonts.</p>
<p>For many years, “smart” font formats such as OpenType and AAT have provided font designers ways of including a rich set of variations in their fonts, from ligatures and swashes to small caps and tabular figures. The OpenType specification <a href="http://www.microsoft.com/typography/otspec/featurelist.htm">describes these features</a>, identifying each with a unique feature tag. But these have typically only been available to those using professional publishing applications such as Adobe InDesign. Firefox currently renders using font defaults; it would be much more interesting to provide web authors with a way of controlling these font features via CSS.</p>
<p>Håkon Wium Lie of Opera, based on discussions with Tal Leming and Adam Twardoch, <a href="http://lists.w3.org/Archives/Public/www-style/2008Jan/0380.html">proposed extending the CSS &#8216;font-variant&#8217; property</a> to include values for font features. Mozilla is <a href="http://lists.w3.org/Archives/Public/www-style/2009Jun/0506.html">actively working on a new proposal</a> along these lines. This is a fairly big addition to CSS, so it will most likely involve some complex discussions about how best to support these features. </p>
<p><b>Experimental Implementation</b></p>
<p>As part of this effort, Jonathan Kew has been working on porting a portion of the Pango library for use with handling complex scripts and to enable the use of font features on all supported platforms. He currently has an <a href="http://people.mozilla.com/~jkew/feature-samples/">experimental build</a> that uses a special CSS property to associate a list of OpenType features with specific elements in a page. This is <strong>not</strong> the <a href="http://lists.w3.org/Archives/Public/www-style/2009Jun/0506.html">proposed format</a>, it simply provides a better way of discussing possible sets of font-variant properties and the OpenType feature settings to which they should map.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.altstyles</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #808080; font-style: italic;">/* format: feature-tag=[0,1] with 0 to disable, 1 to enable */</span>
  -moz-font-feature-opentype<span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;dlig=1,ss01=1&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The feature setting string above implies rendering with discretionary ligatures (dlig) and the first set of stylistic alternates (ss01). An example using Jack Usine&#8217;s <a href="http://www.smeltery.net/fonts/megalopolis-extra">MEgalopolis Extra</a>: </p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/withlove.html"><img src="https://wiki.mozilla.org/images/6/6f/Withlove.png"/></a></p>
<p>This font makes extensive use of OpenType features; the <a href="http://www.smeltery.net/fonts/megalopolis-extra">homepage of the font contains a sample rendering</a> that uses many of these features. Below is a rendering of the same sample written in HTML with OpenType features enabled: </p>
<p><a href="http://people.mozilla.com/~jkew/feature-samples/MEgalopolis.html"><img src="https://wiki.mozilla.org/images/9/95/Megalopolis.png"/></a></p>
<p><b>Tabular Figures for Numerical Alignment</b></p>
<p>OpenType features also enable better control over alignment. When numbers are listed in tabular form, proportional forms often result in the misalignment of digits across rows, making the list harder to scan. With tabular alignment enabled, individual digits are rendered using a fixed width so that digits align across rows:</p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/tabulardata.html"><img src="https://wiki.mozilla.org/images/a/a0/Flavorfigures.png"/></a></p>
<p><b>Automatic Fractions</b></p>
<p>Automatic fractions are also possible with OpenType features, note the inline use of fractional forms in the recipe ingredient list below: </p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/tiramisu.html"><img src="https://wiki.mozilla.org/images/b/b8/Tiramisu.png"/></a></p>
<p><b>Language Sensitivity</b></p>
<p>OpenType also includes support for features on a per-language basis. This is important for rendering text correctly in some languages. For example, Turkish uses both a dotted-i and a dotless-i, so the distinction needs to be preserved when rendering ligatures or small caps. Below is the same text in English and Turkish, with both default and language-sensitive renderings shown for the Turkish text: </p>
<p><a href="http://people.mozilla.com/~jkew/feature-samples/udhr-turkish.html"><img src="https://wiki.mozilla.org/images/d/d8/Udhrturkish.png"/></a></p>
<p><b>Historical Text</b></p>
<p>The way text is rendered constantly evolves; glyphs once in common use often morph into other forms, making the historical forms distinct from their modern forms. Below is the text of an old Massachusetts Bay Colony law, taken from a book in the <a href="http://www.bc.edu/schools/law/library/about/rarebook/exhibitions/newacq08.html">Daniel R. Coquillette Rare Book Room</a> of the Boston College Law Library. </p>
<p>Original scanned image: </p>
<p><a href="http://www.bc.edu/schools/law/library/about/rarebook/exhibitions/newacq08.html"><img src="https://wiki.mozilla.org/images/5/5a/Bookexcerpt.png"/></a></p>
<p>Below is the same text rendered in HTML using the <a href="http://www.iginomarini.com/">Fell Types revival fonts by Igino Marini</a> with OpenType features enabled. Note the ‘ct’ ligature and the contextual form of the ‘s’:</p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/historicaltext.html"><img src="https://wiki.mozilla.org/images/5/52/Historicaltext.png"/></a></p>
<p><b>More resources</b></p>
<p><a href="http://lists.w3.org/Archives/Public/www-style/2009Jun/0506.html">Font feature support in CSS proposal</a><br />
<a href="http://www.microsoft.com/typography/otspec/featurelist.htm">OpenType font feature list</a><br />
<a href="http://www.iginomarini.com">Fell Types revival fonts by Igino Marini</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/10/font-control-for-designers/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
<enclosure url="http://videos.mozilla.org/serv/blizzard/woff/features-screencast-500.ogv" length="4402211" type="video/ogg" />
		</item>
		<item>
		<title>Web Open Font Format for Firefox 3.6</title>
		<link>http://hacks.mozilla.org/2009/10/woff/</link>
		<comments>http://hacks.mozilla.org/2009/10/woff/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 16:00:09 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Firefox 3.6]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=1921</guid>
		<description><![CDATA[This article was written by John Daggett. John is a Mozilla contributor and has been working hard with font creators and web developers to improve the state of fonts on the web. This article is a high-level overview of whats different and shows some examples of WOFF in use. A full list of other supporting [...]]]></description>
			<content:encoded><![CDATA[<p><em>This article was written by John Daggett.  John is a Mozilla contributor and has been working hard with font creators and web developers to improve the state of fonts on the web.  This article is a high-level overview of whats different and shows some examples of WOFF in use.  A full list of other supporting organizations <a href="http://blog.mozilla.com/blog/2009/10/20/mozilla-supports-web-open-font-format/">can be found at the official Mozilla Blog</a>.</em></p>
<p>In Firefox 3.5 we <a href="http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/">included support for linking to TrueType and OpenType fonts</a>.  In Firefox 3.6 we&#8217;re including support for a new font format &#8211; the Web Open Font Format, or WOFF.  This format has two main advantages over raw TrueType or OpenType fonts.</p>
<ol>
<li>It is compressed, which means that you will typically see much smaller download sizes compared with raw TrueType or OpenType fonts.
<li>It contains information that allows you to see where the font came from &#8211; without DRM or labeling for a specific domain &#8211; which means it has support from a <a href="http://typegirl.tumblr.com/post/142912558/most-of-the-important-foundries-are-supporting-webfont">large number of font creators and font foundries</a>.
</ol>
<p>The WOFF format originated from a collabaration between the font designers <a href="http://www.letterror.com/">Erik van Blokland</a> and <a href="http://talleming.com/">Tal Leming</a> with help from Mozilla&#8217;s Jonathan Kew.  Each had proposed their own format and WOFF represents a melding of these different proposals.  The  <a href="http://people.mozilla.com/~jkew/woff/woff-spec-latest.html"> format itself</a> is intended to be a simple repackaging of OpenType or TrueType font data, it doesn&#8217;t introduce any new behavior, alter the @font-face linking mechanism or affect the way fonts are rendered.  Many font vendors have <a href="http://typegirl.tumblr.com/post/142912558/most-of-the-important-foundries-are-supporting-webfont"> expressed support for this new format</a> so the hope is this will open up a wider range of font options for web designers.</p>
<p><b>Details on Differences between TrueType, OpenType and WOFF</b></p>
<p>First, compression is part of the WOFF format so web authors can optimize the size of fonts used on their pages.  The compression format is lossless, the uncompressed font data will match that of the original OpenType or TrueType font, so the way the font renders will be the same as the original.  Similar compression can be achieved using general HTTP compression but because compression is part of the WOFF format, it&#8217;s simpler for authors to use, especially in situations where access to server configuration is not possible.</p>
<p>Second, the format includes optional metadata so that a font vendor can tag their fonts with information related to font usage.  This metadata doesn&#8217;t affect how fonts are loaded but tools can use this information to identify the source of a given font, so that those interested in the design of a given page can track down the fonts used on that page.  Fonts in WOFF format are compressed but are not encrypted, the format should not be viewed as a &#8220;secure&#8221; format by those looking for a mechanism to strictly regulate and control font use.</p>
<p>Note: until Firefox 3.6 ships, users can test the use of WOFF fonts with Firefox <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/"> nightly builds</a>.</p>
<p><b>Examples</b></p>
<p>Below is a simple example that shows how to construct an @font-face rule that links to a WOFF font. To support browsers that only support direct linking to OpenType and TrueType fonts, the &#8216;src&#8217; descriptor lists the WOFF font first along with a format hint (&#8220;woff&#8221;), followed by the TrueType version:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Gentium (SIL International) */</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> GentiumTest<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>fonts/GenR102.woff<span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;woff&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
       <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>fonts/GenR102.ttf<span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;truetype&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> GentiumTest<span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> Times New Roman<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Structured this way, browsers that support the WOFF format will download the WOFF file. Other browsers that support @font-face but don&#8217;t yet support the WOFF format will use the TrueType version. (Note: IE support is a bit trickier, as discussed below).　As WOFF is adopted more widely the need to include links to multiple font formats will diminish. </p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/gentium-test.html"><img src="https://wiki.mozilla.org/images/7/7e/Gentiumtest.png"></a></p>
<p>Other examples below demostrate the use of WOFF formatted fonts but each example has been constructed so that it will work in any browser that supports @font-face, including Internet Explorer. </p>
<p><b>A font family with multiple faces</b></p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/droidserif-test.html"><img src="https://wiki.mozilla.org/images/7/72/Droidtest.png"></a></p>
<p><b>Using a Postscript CFF font</b></p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/chunkfive-test.html"><img src="https://wiki.mozilla.org/images/9/97/Chunkfivetest.png"></a></p>
<p><b>African Language Display</b></p>
<p>Below is an example of how downloadable fonts can be used to render languages for which font support is usually lacking. The example shows the UN Declaration of Human Rights, translated into two African languages, and how these render with default browser fonts vs. with a downloadable font suited for rendering these languages.</p>
<p>Note that in one of these examples that the font size goes from a 3.1MB TTF to a 1MB WOFF font and in the other from a 172KB TTF to an 80KB WOFF file.</p>
<p><a href="http://people.mozilla.com/~jkew/woff/udhr-sample/"><img src="https://wiki.mozilla.org/images/9/92/Charissiltest.png"/></a></p>
<p><b>Another Postscript CFF font</b></p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/goudy1911-test.html"><img src="https://wiki.mozilla.org/images/3/35/Goudy1911test.png"/></a></p>
<p><b>An example in Japanese</b></p>
<p><a href="http://people.mozilla.org/~jdaggett/webfonts/mplus-test.html"><img src="https://wiki.mozilla.org/images/f/f8/Mlustest.png"/></a></p>
<p><b>Working With Other Browsers</b></p>
<p>Firefox 3.6 will be the first shipping browser to support the WOFF format so it&#8217;s important to construct @font-face rules that work with browsers lacking WOFF support. One thing that helps greatly with this is the use of format hints to indicate the format of font data before it&#8217;s downloaded; browsers that don&#8217;t recognize a given format simply skip data in a format they don&#8217;t support.</p>
<p>Internet Explorer, including IE8, only supports the EOT font format and only implements a subset of the @font-face rule descriptors. This makes creating cross-platform @font-face rules that work with IE especially tricky. One solution is to make different rules for IE:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> GentiumTest<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>fonts/GenR102.eot<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #808080; font-style: italic;">/* for IE */</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> GentiumTest<span style="color: #00AA00;">;</span>
  <span style="color: #808080; font-style: italic;">/* Works only in WOFF-enabled browsers */</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>fonts/GenR102.woff<span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;woff&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>One minor downside of this is that IE doesn&#8217;t understand format hints and doesn&#8217;t parse @font-face URL&#8217;s correctly, it treats format hints as part of the URL, so web authors using the @font-face rules above will see the following in their access logs:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">GET /fonts/GenR102.eot HTTP/1.1&quot; 200 303536
GET /fonts/GenR102.woff)%20format(%22woff%22) HTTP/1.1&quot; 404 335</pre></div></div>

<p>IE successfully pulls down and uses the EOT version of the font but also tries to pull down the WOFF font with the format hint included in the URL. This fails and doesn&#8217;t affecting page rendering but it wastes valuable server resources. For more discussion, see Paul Irish&#8217;s blog post for <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">one interesting workaround</a>.</p>
<p>Another problem is that IE currently tries to download <strong>all</strong> fonts on the page, whether they are used or not. That makes site-wide stylesheets containing all fonts used on site pages difficult, since IE will always try to download all fonts defined in @font-face rules, wasting lots of server bandwidth. </p>
<p><b>Further Resources</b></p>
<p><b>Documentation</b></p>
<p><a href="http://people.mozilla.com/~jkew/woff/woff-spec-latest.html">Latest draft WOFF specification</a><br />
<a href="http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/">Original blog post on using @font-face</a><br />
<a href="http://dev.w3.org/csswg/css3-fonts/">CSS3 Fonts working draft</a><br />
<a href="https://developer.mozilla.org/en/CSS/@font-face">MDC @font-face documentation</a></p>
<p><b>Tools</b></p>
<p><a href="http://people.mozilla.com/~jkew/woff/woff-code-latest.zip">Jonathan Kew&#8217;s sample encoding/decoding code</a><br />
<a href="http://code.typesupply.com/wiki/woffTools">woffTools &#8211; tools for examining and validating WOFF files</a><br />
<a href="http://sourceforge.net/projects/fonttools/">FontTools/TTX &#8211; Python library and tool for manipulating font data</a><br />
<a href="http://fonts.philip.html5.org/">Web-based font subsetting tool</a></p>
<p><b>General @font-face Examples</b></p>
<p><a href="http://www.alistapart.com/articles/cssatten">CSS @ Ten: The Next Big Thing</a><br />
<a href="http://nicewebtype.com/fonts/graublau-sans-web/">Example layout using Graublau Sans</a><br />
<a href="http://typeinspire.com/">Examples of Interesting Web Typography</a><br />
<a href="http://webtypography.net/">The Elements of Typographic Style Applied to the Web</a></p>
<p><b>Font Resources</b></p>
<p><a href="http://www.fontsquirrel.com/">Font Squirrel</a><br />
<a href="http://opentype.info/demo/webfontdemo.html">10 Great Free Fonts for @font-face</a><br />
<a href="http://www.smashingmagazine.com/2007/11/08/40-excellent-freefonts-for-professional-design/">40 Excellent Free Fonts by Smashing Magazine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/10/woff/feed/</wfw:commentRss>
		<slash:comments>252</slash:comments>
		</item>
		<item>
		<title>(r)evolution number 5</title>
		<link>http://hacks.mozilla.org/2009/07/revolution-number-5/</link>
		<comments>http://hacks.mozilla.org/2009/07/revolution-number-5/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 03:39:57 +0000</pubDate>
		<dc:creator>Arun Ranganathan</dc:creator>
				<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Firefox 3.5]]></category>
		<category><![CDATA[Geolocation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=1204</guid>
		<description><![CDATA[We&#8217;ve just launched Firefox 3.5, and we&#8217;re incredibly proud. Naturally, we have engaged in plentiful Mozilla advocacy &#8212; this site is, amongst other things, a vehicle for showcasing the latest browser&#8217;s new capabilities. We like to think about this release as an upgrade for the whole World Wide Web, because of the new developer-facing features [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just launched <a href="http://www.mozilla.com/en-US/">Firefox 3.5</a>, and <a href="http://www.flickr.com/photos/gen/3677579248/"/> we&#8217;re</a> <a href="http://www.flickr.com/photos/nitot/3675934390/">incredibly</a> <a href="http://www.flickr.com/photos/29142435@N08/3674981992/">proud</a>.  Naturally, we have engaged in plentiful Mozilla advocacy &#8212; this site is, amongst other things, a vehicle for showcasing the latest browser&#8217;s new capabilities.  We like to think about this release as an upgrade for the <em>whole World Wide Web</em>, because of the new developer-facing features that have just been introduced into the web platform.  When talking about some of the next generation standards, the appearance of the number &#8220;5&#8243; is almost uncanny &#8212; consider <a href="http://dev.w3.org/html5/spec/Overview.html">HTML5</a> and <a href="http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf">ECMAScript 5 (PDF)</a>.   The recent (and very welcome) hype around HTML5 in the press is what motivates this article.  Let&#8217;s take a step back, and consider some of Mozilla&#8217;s web advocacy in the context of events leading up to the release of Firefox 3.5.</p>
<p>Standardization of many of these features often came after much spirited discussion, and we&#8217;re pleased to see the prominent placement of HTML5 as a <a href="http://radar.oreilly.com/2009/05/google-bets-big-on-html-5.html">key strategic initiative</a> by major web development companies.  Indeed, <a href="http://news.cnet.com/8301-17939_109-10252252-2.html">exciting new web applications</a> hold a great deal of promise, and really showcase what the future of the web platform holds in store for aspiring developers.  Many herald the triumphant arrival of the <a href="http://news.cnet.com/8301-17939_109-10250196-2.html">browser as the computer</a>, an old theme that <a href="http://developer.palm.com/webos_book/book1.html">gets bolstered</a> with the arrival of <a href="http://htmlfive.appspot.com/">attractive HTML5 platform features</a> that are implemented across <a href="http://www.apple.com/safari/">Safari</a>, <a href="http://www.google.com/chrome/intl/en/features.html">Chrome</a>, <a href="http://www.opera.com/">Opera</a>, and of course, <a href="http://www.getfirefox.com/">Firefox</a> (with <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">IE8</a> getting an honorable mention for having both some HTML5 features and some ECMAScript, 5th Edition features).</p>
<p>Call it what you will &#8212; Web 5.0, Open Web 5th Generation (wince!), or, (R)evolution # 5, the future is now.  But lest anyone forget, HTML5 is not a completed standard yet, as the <a href="http://www.w3.org/QA/2009/05/_watching_the_google_io.html">W3C was quick to point out</a>.  The editor doesn&#8217;t anticipate completion till 2010.  The path taken from the start of what is now called HTML5 to the present-day era of (very welcome) hype has been a long one, and Mozilla has been part of the journey from the very beginning.</p>
<p>For one thing, we were there to <a href="http://weblogs.mozillazine.org/roadmap/archives/2004/06/the_nonworld_no_1.html">point out, in no uncertain terms</a>, that the <a href="http://www.w3.org/">W3C</a> had perhaps <a href="http://dbaron.org/log/2004-06#e20040609a">lost its way</a>.  Exactly 5 summers ago (again, with that magic number!), it became evident that the W3C was no longer able to serve as sole custodian of the standards governing the open web of browser-based applications, so Mozilla, along with Opera, started the <a href="http://www.whatwg.org/">WHATWG</a>.  Of course, back then, we didn&#8217;t call it HTML5, and while Firefox itself made a splash in 2004, the steps taken towards standardization were <a href="http://ln.hixie.ch/?start=1088526392&#038;count=1">definitive but tentative</a>.  Soon, other browser vendors joined us, and by the time <a href="http://dig.csail.mit.edu/breadcrumbs/node/166">the reconciliation with W3C</a> occurred two years later, the innovations introduced into the web platform via the movement initiated by Mozilla had gained substantial momentum.  </p>
<p>The net result is a specification that is not yet complete called &#8220;HTML5&#8243; which is implemented piecemeal by most modern browsers.  The features we choose to implement as an industry are in response to developers, and our <em>modus operandi</em> is (for the most part) <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/">in</a> the <a href="http://lists.w3.org/Archives/Public/public-html/">open</a>.  Mozilla funds the <a href="http://validator.nu/">HTML5 Validator</a>, producing the first real HTML5 parser, which now drives <a href="http://validator.w3.org/">W3C&#8217;s markup validation</a> for HTML5.  That parser has made its way back into Firefox.  It&#8217;s important to note that capabilities that are of greatest interest (many of which are showcased on this blog) are not only developed within the HTML5 specification, but also as part of the <a href="http://www.w3.org/2008/geolocation/">W3C Geolocation WG</a>, the <a href="http://www.w3.org/2008/webapps/">Web Apps WG</a>, and the <a href="http://www.w3.org/Style/CSS/current-work">CSS WG</a>.</p>
<p>The release of Firefox 3.5, along with updates to other modern browsers, seems to declare that HTML5 has arrived.  But with the foresight that comes with having been around this for a while, we also know that we have a lot of work ahead of us.  For one thing, we&#8217;ve got to finish HTML5, or at least publish a subset of it that we all agree is ready for implementation, <strong>soon</strong>.  We&#8217;ve also got to ensure that <a href="http://lists.w3.org/Archives/Public/public-html/2009Jun/0661.html">accessibility serves as an important design principle</a> in the emerging web platform, and resolve sticky differences here.  Also, an open standard <em>does not</em> an open platform make, as debates about <a href="http://cwilso.com/2008/07/23/fonts-embedding-vs-linking/">web</a> <a href="http://dbaron.org/log/20090317-fonts">fonts</a> and <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-June/020363.html">audio/video</a> <a href="http://lists.w3.org/Archives/Public/public-html/2009Jun/0825.html">codecs</a> show.  We&#8217;ve got a lot of work ahead of us, but for now, 5 years after the summer we started the ball rolling, we&#8217;re enjoying the hype around (R)evolution Number 5.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/07/revolution-number-5/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>the potential of web typography</title>
		<link>http://hacks.mozilla.org/2009/06/web-typography/</link>
		<comments>http://hacks.mozilla.org/2009/06/web-typography/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 18:56:16 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[35 Days]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox 3.5]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=1000</guid>
		<description><![CDATA[This post counts as both a demo and commentary about the changing nature of typography on the web. Ian Lynam and Craig Mod have put together a page that is an excellent example of typography in action, but also offer some suggestions on what the next steps for typography on the web might look like. [...]]]></description>
			<content:encoded><![CDATA[<p><em>This post counts as both a demo and commentary about the changing nature of typography on the web.  <a href="http://ianlynam.com/">Ian Lynam </a> and <a href="http://craigmod.com/">Craig Mod</a> have <a href="http://craigmod.com/journal/font-face/">put together a page</a> that is an excellent example of typography in action, but also offer some suggestions on what the next steps for typography on the web might look like.  The page itself takes advantage of a number of typefaces that Craig and Ian got permission to use and uses a pleasing multi-column layout.  Please click through to the complete article to get the full effect.</em></p>
<div align="center" style="font-size: 120%"><a target="_blank" href="http://craigmod.com/journal/font-face/">View the Demo in Firefox 3.5<br/><img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/potential.png" alt="potential" title="potential" width="500" height="372" class="aligncenter size-full wp-image-1006" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/06/web-typography/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>web fonts and css features &#8211; a simple demonstration</title>
		<link>http://hacks.mozilla.org/2009/06/fonts-css-layout/</link>
		<comments>http://hacks.mozilla.org/2009/06/fonts-css-layout/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 04:25:08 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[35 Days]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox 3.5]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=377</guid>
		<description><![CDATA[This post is from Laurent Jouanneau, who was kind enough to build a very simple but elegant demonstration of how to use web fonts and some of the new CSS features in Firefox 3.5. View the Demo in Firefox 3.5 Shadows and round corners First, we set some style properties on the toolbar: -moz-border-radius -moz-border-radius:10px [...]]]></description>
			<content:encoded><![CDATA[<p><em>This post is from <a href="http://ljouanneau.com/">Laurent Jouanneau</a>, who was kind enough to build a very simple but elegant demonstration of how to use web fonts and some of the new CSS features in Firefox 3.5.</em></p>
<p><a target="_blank" href="http://ljouanneau.com/lab/css3/font_shadow_radius/font_shadow_radius.html"></p>
<div align="center" style="font-size: 120%">
<strong>View the Demo in Firefox 3.5</strong><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/font_shadow_radius.png" alt="font_shadow_radius" title="font_shadow_radius" width="500" class="aligncenter size-full wp-image-379" />
</div>
<p></a></p>
<p><strong>Shadows and round corners</strong></p>
<p>First, we set some style properties on the toolbar:</p>
<p><a href="https://developer.mozilla.org/en/CSS/-moz-border-radius">-moz-border-radius</a></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>This indicates that top left and bottom right border corner should be round with a radius of 10 pixels. </p>
<p><a href="https://developer.mozilla.org/en/CSS/-moz-box-shadow">-moz-box-shadow</a></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9BD1DE</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>This indicates that a shadow should be drawn under the div, with an offset of 5 pixels to the right and the bottom, and with a blur radius of 6 pixels. </p>
<p>Second, the buttons. We still use a <code>border-radius property</code>. But we use also a box-shadow property which changes depending of the state of the button. In the normal state, there is a shadow outside the button. When the mouse hovers over it (the <em>hover</em> state), the shadow is changed to be inside the button using the <code>inset</code> CSS property.  We do the same thing when we click on the button (the <em>active</em> state), but we also make the shadow is bigger and darker.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#superbox</span> button <span style="color: #00AA00;">&#123;</span>
    -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
    -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#superbox</span> button<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
    -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">inset</span> <span style="color: #cc00cc;">#989896</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#superbox</span> button<span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span>
    -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">inset</span> <span style="color: #cc00cc;">#1C1C1C</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>You can also see that we add a red shadow under the text of the button when the mouse hovers over it using the <a href="https://developer.mozilla.org/en/CSS/text-shadow">text-shadow</a> property.</p>
<p><strong>Web fonts</strong></p>
<p>Each button is rendered with its own font, declared using <a href="http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/">@font-face</a>. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Brock Script<span style="color: #00AA00;">;</span>
    src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;BrockScript.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>With the <code>font-family</code> property, we indicate a name for our font.  The <code>src</code> indicates the url of the downloadable font.</p>
<p>Once we&#8217;ve defined the <code>@font-face</code> property we can use it in the CSS for one of the buttons:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.first</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Brock Script<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>When you declare the font with @font-face, and then use the font in CSS, the browser will automatically download and render using that font.  The browser won&#8217;t download fonts you don&#8217;t use, so it&#8217;s safe to include descriptions of fonts from a common CSS file that might not be used in the page that you&#8217;re currently displaying.</p>
<p>In the demonstration there&#8217;s also a small amount of script connected to each of the buttons that changes the class of the blue box to use the downloaded font for that button showing that you can update fonts on the fly as well.</p>
<p>With these relatively simple techniques we can have beautiful buttons without having to use a bitmap image.</p>
<p>Note: these fonts can be downloaded from <a href="http://www.fontsquirrel.com/fonts/">fontsquirrel.com</a> : <a href="http://www.fontsquirrel.com/fonts/Brock-Script">Brock-Script</a> (created by Dieter Steffmann), <a href="http://www.fontsquirrel.com/fonts/Sniglet">Sniglet</a> (created by The League of Moveable Type, under the licence CC-by-sa) and <a href="http://www.fontsquirrel.com/fonts/Quick-End-Jerk">Quick End Jerk</a> (created by Vic Fieger).</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/06/fonts-css-layout/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>beautiful fonts with @font-face</title>
		<link>http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/</link>
		<comments>http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:22:07 +0000</pubDate>
		<dc:creator>John Daggett</dc:creator>
				<category><![CDATA[35 Days]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[Firefox 3.5]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=242</guid>
		<description><![CDATA[While Firefox 3.0 improved typographic rendering by introducing support for kerning, ligatures, and multiple weights along with support for rendering complex scripts, authors are still limited to using commonly available fonts in their designs. Firefox 3.5 removes this restriction by introducing support for the CSS @font-face rule, a way of linking to TrueType and OpenType [...]]]></description>
			<content:encoded><![CDATA[<p>While Firefox 3.0 improved typographic rendering by introducing support for kerning, ligatures, and multiple weights along with support for rendering complex scripts, authors are still limited to using commonly available fonts in their designs. Firefox 3.5 removes this restriction by introducing support for the CSS <a href="https://developer.mozilla.org/en/CSS/@font-face">@font-face</a> rule, a way of linking to TrueType and OpenType fonts just as code and images are linked to today. Safari has supported this type of font linking since version 3.1, and Opera has announced that they plan to support it in Opera 10.</p>
<p>Using @font-face for font linking is relatively straightforward. Within a stylesheet, each @font-face rule defines a family name to be used, the font resource to be loaded, and the style characteristics of a given face such as whether it&#8217;s bold or italic. Firefox 3.5 only downloads the fonts as needed, so a stylesheet can list a whole set of fonts of which only a select few will actually be used.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Graublau Sans Web (www.fonts.info) */</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Graublau Sans Web<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">GraublauWeb.otf</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;opentype&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Graublau Sans Web<span style="color: #00AA00;">,</span> Lucida Grande<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Browsers that support @font-face will render text using Graublau Sans Web while older browsers will render text using either Lucida Grande or the default sans-serif face. Example <a href="http://people.mozilla.org/~jdaggett/demos/simplefontface.html">here</a>: </p>
<p><a href="http://people.mozilla.org/~jdaggett/demos/simplefontface.html"><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/graublausanswebdemo.png"/><br />
</a></p>
<p><strong>Digging A Little Deeper</strong></p>
<p>Most font families today consist of only four faces: regular, bold, italic and bold italic. To define each of these faces the <em>font-weight</em> and <em>font-style</em> descriptors are used. These define the style of the face; there&#8217;s no concept of a cascade or inheritance that applies here. Without an explicit definition each of these defaults to a value of &#8216;normal&#8217;:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Gentium by SIL International   */</span>
<span style="color: #808080; font-style: italic;">/* http://scripts.sil.org/gentium */</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Gentium<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">Gentium.ttf</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  <span style="color: #808080; font-style: italic;">/* font-weight, font-style ==&gt; default to normal */</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Gentium<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">GentiumItalic.ttf</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">italic</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Gentium<span style="color: #00AA00;">,</span> Times New Roman<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The <a href="http://people.mozilla.org/~jdaggett/demos/multiplefaces.html">sample text</a> below when rendered with this font family: </p>
<p><a href="http://people.mozilla.org/~jdaggett/demos/multiplefaces.html"><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/multiplefaces.png"/><br />
</a></p>
<p>A feature that&#8217;s easy to overlook is that @font-face allows the creation of families with more than just regular and bold faces &#8212; up to nine weights can be defined for a single family. This is true even on Windows, where underlying platform limitations usually restrict font families to just regular and bold weights. Fonts such as those of the Japanese open source <a href="http://mplus-fonts.sourceforge.jp/">M+ Fonts project</a> have as many as seven weights. A selection of these are used in the <a href="http://people.mozilla.org/~jdaggett/demos/multipleweights.html">sample</a> below: </p>
<p><a href="http://people.mozilla.org/~jdaggett/demos/multipleweights.html"><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/multipleweights.png"/><br />
</a></p>
<p>In some situations, authors may prefer to use fonts available locally and only download fonts when those faces aren&#8217;t available. This is possible with the use of <em>local()</em> in the definition of the <em>src</em> descriptor of an @font-face rule. The browser will iterate over the list of fonts in the src descriptor until it successfully loads one.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* MgOpen Moderna                      */</span>
<span style="color: #808080; font-style: italic;">/* http://www.zvr.gr/typo/mgopen/index */</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> MyHelvetica<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;Helvetica Neue&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> 
       local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;HelveticaNeue&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> 
       <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">MgOpenModernaRegular.ttf</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> MyHelvetica<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;Helvetica Neue Bold&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> 
       local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;HelveticaNeue-Bold&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> 
       <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">MgOpenModernaBold.ttf</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> MyHelvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The screenshot below shows from top to bottom the results on Mac OS X, Windows and Linux for a <a href="http://people.mozilla.org/~jdaggett/demos/localfallback.html">simple testcase</a> that uses the font family defined above: </p>
<p><a href="http://people.mozilla.org/~jdaggett/demos/localfallback.html"><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/macwinlinrendering.png"/><br />
</a></p>
<p>The Helvetica Neue font family is available on most Mac OS X systems but generally on neither Windows nor Linux machines. When the example here is rendered on Mac OS X, the local Helvetica Neue faces are used and no font is downloaded. Under Windows and Linux the attempt to load a local font fails and a substitute font &#8212; MgOpen Moderna &#8212; is downloaded and used instead. MgOpen Moderna is designed to be a substitute for Helvetica, so it renders similarly to Helvetica Neue. This way, an author can guarantee text appearance but avoid a font download when it&#8217;s unnecessary.</p>
<p>The name used to refer to a specific font face is the full name for an individual font. Generally it&#8217;s the family name plus the style name (e.g. &#8220;Helvetica Bold&#8221;). Under Mac OS X, the name is listed in the information panel for a given face. Select a single face and choose &#8216;Show Font Info&#8217; from the Preview menu in FontBook: </p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/fontbookinfo.png"/></p>
<p>Similar tools exist under Linux. On Windows, use the <a href="http://www.microsoft.com/typography/FreeToolsOverview.mspx">font properties extension</a>, a free download from Microsoft to view these names. With the extension installed, the properties panel shows information about an individual font. The full name is referred to as the &#8220;Font Name&#8221; on the Name tab: </p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/fontproperties.png"/></p>
<p>Safari only supports PostScript name lookup under Mac OS X, so under Mac OS X Postscript names are also supported. For OpenType PS fonts (often labeled with an .otf extension) the full name is the same as the PostScript name under Windows. So for these fonts, authors are advised to include both the full name and the PostScript name for cross-platform interoperability. </p>
<p><strong>Supporting Many Languages</strong></p>
<p>Many languages suffer from a lack of commonly available fonts. For minority languages and ancient scripts, the options often dwindle to just a handful. The use of @font-face allows authors using these languages to ameliorate this by including fonts with their pages.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Scheherazade<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">fonts/ScheherazadeRegAAT.ttf</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;truetype-aat&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> 
       <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">fonts/ScheherazadeRegOT.ttf</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;opentype&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Scheherazade<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Languages such as Arabic require text shaping, where the display of a given character is affected by the characters surrounding it. Different platforms support different rendering technologies to enable text shaping; under Mac OS X, AAT fonts are required while under Windows and Linux OpenType fonts are required. Without a font in a format required for a given platform, text shaping will not be rendered correctly. </p>
<p><a href="http://people.mozilla.org/~jdaggett/demos/arabicfont.html"><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/arabicsample.png"/><br />
</a></p>
<p>Under Mac OS X, the AAT version of the font is downloaded. On Windows and Linux, where rendering with AAT fonts is not supported, the download of the AAT font is skipped and the OpenType font is used instead. Hence, the text is rendered correctly on all platforms. </p>
<p><strong>Cross-Site Font Usage</strong></p>
<p>By default, Firefox 3.5 only allows fonts to be loaded for pages served from the same site. This prevents sites from freely using fonts found on other sites. For sites that explicitly want to allow cross-site font sharing, an online font library for example, Firefox 3.5 supports the use of <a href="http://www.w3.org/TR/access-control/">access control headers</a> to control this behavior. By adding an additional header to the HTTP headers sent with font files, sites can enable cross-site usage.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># example Apache .htaccess file to add access control header
&nbsp;
&lt;FilesMatch &quot;\.(ttf|otf)$&quot;&gt;
&lt;IfModule mod_headers.c&gt;
Header set Access-Control-Allow-Origin &quot;*&quot;
&lt;/IfModule&gt;
&lt;/FilesMatch&gt;</pre></div></div>

<p>With this HTTP header enabled, any page can access the fonts on this site, not just pages from the same site. </p>
<p><strong>Font Licensing Issues</strong></p>
<p>When using a font for a website, it&#8217;s important to always confirm that the font license permits use on a website. If the license agreement is filled with opaque legalese, err on the side of caution and check with the font vendor before using a font on a site. If the license permits its use, it&#8217;s a good idea to add a comment near the @font-face rules that points to the license, for future reference.</p>
<p><em>“I found a free font, can I use it on my site?”</em></p>
<p>Maybe, maybe not. Some free fonts are distributed as teaser products to encourage a purchase and don&#8217;t allow for redistribution or posting on a web server. Check the license, even for free fonts.</p>
<p><em>“I just want to use [insert favorite font name here] on my site. Is that possible?”</em></p>
<p>Right now, probably not. The use of font linking on the web is still in its infancy. Most fonts that ship with proprietary OS&#8217;s today have licenses that limit their use to standard desktop applications, so uploading these fonts to a web server is almost certainly not permitted. Piracy has plagued the font industry in the past, so most font vendors are wary of allowing their fonts to be used except in relatively limited contexts. Many font vendors are focused on the needs of publishing and printing industries, and the relative complexity of their license agreements often reflects this. In the future, some font designers may conclude that the sales of fonts as web fonts will outweigh any potential loss in sales due to piracy, others may not. Their license agreements will reflect this choice and should be respected.</p>
<p>The stock photography market is often described as a $2 billion market but the web font market is still close to a $0 market, it can only go up! </p>
<p><strong>Font Linking In Internet Explorer</strong></p>
<p>Font linking has been possible with Internet Explorer but only for linking to fonts in the proprietary EOT font format. The only way to create EOT fonts is to use the <a href="http://www.microsoft.com/typography/WEFT.mspx">Microsoft WEFT tool</a>, available only on Windows. Only TrueType and OpenType TT fonts can be converted to EOT format, OpenType PS (.otf) fonts cannot be used.</p>
<p>Internet Explorer only recognizes the <em>font-family</em> and <em>src</em> descriptors within @font-face rules, so each family can only contain a single face. It doesn&#8217;t understand <em>format()</em> hints and will ignore any @font-face rule containing these hints. This behavior can be used enable font linking cross platform:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Font definition for Internet Explorer */</span>
<span style="color: #808080; font-style: italic;">/*         (*must* be first)             */</span>
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Gentium<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">Gentium.eot</span><span style="color: #00AA00;">&#41;</span> <span style="color: #808080; font-style: italic;">/* can't use format() */</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Font definition for other browsers */</span>
<span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Gentium<span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">Gentium.ttf</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;opentype&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>Future Work</strong></p>
<p>For Firefox 3.5, the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=3512"><em>font-stretch</em></a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=475891"> <em>unicode-range</em></a> descriptors are not supported.  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=119490">Fonts defined in SVG documents</a> are also not supported yet.  These are under consideration for inclusion in future releases.  As always, patches are welcome!</p>
<p><strong>Further Resources</strong></p>
<p><strong>Translations</strong></p>
<ul>
<li><a href="http://www.fatcow.com/edu/beautiful-fonts-with-font-face-be/">Belorussian translation</a>
</ul>
<p><strong>Documentation</strong></p>
<ul>
<li><a href="https://developer.mozilla.org/en/CSS/@font-face">MDC @font-face documentation</a>
<li><a href="http://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html">CSS2 Fonts specification</a>
<li><a href="http://dev.w3.org/csswg/css3-fonts/">CSS3 Fonts draft</a>
<li><a href="http://www.w3.org/TR/access-control/">Cross-Origin Resource Sharing Working Draft</a>
</ul>
<p><strong>Examples</strong></p>
<ul>
<li><a href="http://www.alistapart.com/articles/cssatten">CSS @ Ten: The Next Big Thing</a>
<li><a href="http://nicewebtype.com/fonts/graublau-sans-web/">Example layout using Graublau Sans</a>
<li><a href="http://typeinspire.com/">Examples of Interesting Web Typography</a>
<li><a href="http://webtypography.net/">The Elements of Typographic Style Applied to the Web</a>
</ul>
<p><strong>Font Resources</strong></p>
<ul>
<li><a href="http://www.fontsquirrel.com/">Font Squirrel</a>
<li><a href="http://opentype.info/demo/webfontdemo.html">10 Great Free Fonts for @font-face</a>
<li><a href="http://fonts.philip.html5.org/">Web-based font subsetting tool</a>
<li><a href="http://www.smashingmagazine.com/2007/11/08/40-excellent-freefonts-for-professional-design/">40 Excellent Free Fonts by Smashing Magazine</a>
<li><a href="http://sourceforge.net/projects/fonttools/">FontTools/TTX &#8211; Python scripts for displaying font data</a>
</ul>
<p><strong>Font Politics</strong></p>
<ul>
<li><a href="http://blogs.msdn.com/ie/archive/2008/07/21/font-embedding-on-the-web.aspx">Microsoft&#8217;s Bill Hill about Font Embedding</a>
<li><a href="http://cwilso.com/2008/07/23/fonts-embedding-vs-linking/">Microsoft&#8217;s Chris Wilson about direct linking to TrueType fonts</a>
<li><a href="http://weblogs.mozillazine.org/roc/archives/2008/08/the_coming_batt.html">Robert O&#8217;Callahan&#8217;s blog post on web font formats</a>
<li><a href="http://www.w3.org/Fonts/Misc/minutes-2008-10">Discussion of font formats at W3C TPAC meeting</a>
<li><a href="http://diveintomark.org/archives/2009/04/21/fuck-the-foundries">Mark Pilgrim&#8217;s post critical of font foundries</a>
<li><a href="http://dbaron.org/log/20090317-fonts">David Baron&#8217;s thoughts about downloadable font formats</a>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/feed/</wfw:commentRss>
		<slash:comments>176</slash:comments>
		</item>
	</channel>
</rss>

