13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

42<br />

sIFR me timbers<br />

When you’re dealing with content generated by a CMS, it’s a given that a large portion of the content on every page is constantly<br />

changing. In this particular instance, it’s not fair to assume the band members would be willing or able to create a<br />

custom, graphical text heading for every news item they post to the site via the CMS. And yet as a designer, I would much rather<br />

have the main article heading on the homepage rendered in the same typeface as the band’s logo (Franklin Gothic Condensed).<br />

Fortunately, due in no small part to the extraordinary efforts of a few talented programmers, sIFR came to my rescue.<br />

sIFR stands for Scalable Inman Flash Replacement (Inman, as in Shaun Inman, who conceived the original DOM replacement<br />

method that inspired sIFR). In the words of Mike Davidson, one of sIFR’s creators and all-around web-typography-quality<br />

evangelist, sIFR is “a method to insert rich typography into web pages without sacrificing accessibility, search engine friendliness,<br />

or markup semantics.” Phew. More simply put, sIFR is a way to use specific typefaces to replace HTML text when<br />

viewed in a modern, visual browser, using a combination of Flash and JavaScript. It doesn’t hinder accessibility, and visitors<br />

without Flash (or with JavaScript turned off) will see normal HTML text, with CSS applied. Oh, and did I mention it’s free?<br />

To take advantage of sIFR developers’ selfless generosity, you must first have the following at your disposal:<br />

Macromedia (now Adobe) Flash version 6 or newer (the full version, not the plug-in)<br />

A font you would like to render using sIFR<br />

Some free time<br />

Once you’ve fulfilled those requirements, the process of incorporating sIFR into any project is fairly simple:<br />

1. Download the latest release (2.0.2 as of this writing) from www.mikeindustries.com/sifr/.<br />

2. Read the documentation, at http://wiki.novemberborn.net/sifr/.<br />

OK, so it isn’t that simple, but all the steps are outlined in the documentation. If you follow the instructions, it will work<br />

smoothly. Nonetheless, I will give you a brief overview, along with an example.<br />

The first step, after selecting your typeface, is to export the Flash (.swf) file. The creators of sIFR have kindly included a Flash<br />

document (.fla) with the rest of the files, so you simply open that file in Flash, double-click the text box in the center of<br />

that file, and specify the typeface. Export the file (in this example, the file is named franklingothiccondensed.swf). This<br />

concludes the Flash portion of our exercise.<br />

The sIFR download also includes two CSS style sheets—one for screen and one for print—and a JavaScript file (this is where<br />

the magic happens). You can copy and paste the styles into your own screen and print style sheets, as suggested in the sIFR<br />

documentation, or just link to them, along with the JavaScript file, in the of your document:<br />

<br />

<br />

<br />

Now you have to call sIFR from within your HTML file, and tell the script what to replace. You can also place these “replacement<br />

statements” within the JavaScript file itself; see the sIFR documentation for details.<br />

<br />

if(typeof sIFR == "function"){<br />

sIFR.replaceElement(named({sSelector:"#teaser h3",➥<br />

sFlashSrc:"/sIFR/franklingothiccondensed.swf",sColor:"#EFB32F",➥<br />

sLinkColor:"#EFB32F", sFlashVars:"offsetLeft=0&offsetTop=0",➥<br />

sWmode:"transparent"}));<br />

};<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!