About Us

Bulletpoint StarImulus® is a technology focused design + interactive agency.

In addition to our client services we also have a few products in the works. Our office is always filled with chatter and this blog is an outlet for our creative energy, rants and ideas.

Podium

StacksStacks ®
A group task management solution that finally makes sense.

Sign Up For A Free Trial »

Featured Project

Jan28

sIFR Lite Flash based type replacement, holy shit wow

sifr-thanksOnce in a while you come across a script that makes your life dramatically easier. Today that script was sIFR Lite.

Over the past few months we’ve been working on a client project that requires us to use a specific typeface for page headings on the website. Rather than doing standard -9999px image replacement techniques, which would have made our intern want to gouge out his eyes with an ice pick, we decided to give the sIFR replacement technique a try. sIFR 2.0 is a technique that came out in mid 2005 and has been used by a limited number of sites. Well, as cool as it is I ran into quite a few problems when first implementing it with our project. And while I got it to work I felt slightly dirty about the implementation. Luckily a couple days later I saw a post on twitter by Matt Crest about a new solution called sIFR Lite.

Today, I finally had the chance to replace the old method with the lite version and I have to say it is exceptionally well done. Dave over at AllCrunchy.com has done a phenomenal job with his implementation of the sIFR technique. Making it lighter, easier to use, easier to install, and easier to manage. In fact, it reduces the amount of work by about 5x and in my tests it seems to render better. Better aliasing and better container size detection. Check out the example I whipped up.

Here’s the javascript code required to call sifr-lite:

window.onload = function () {
	var din = new Font('din.swf', {tags:'h1'});
	din.replace('h1')
}

Two quick notes: First, I do find that without using the window.onload function that in Safari sometimes the text won’t pick up color. This is very minor and easy to fix.. obviously. Second, you will need to use the original sIFR to create the .swf files of your font’s. Simply use the .fla and .as files that come with that script to make your fonts, then call those fonts via sifr.lite.js. For those looking for an all in one option I’ve put it together in a zip file. Please recognize I take no credit for the sIFR script or the Lite implementation of it, I simply thought it would be nice to have an all in one package to make things work.

Update: After further testing it seems that this technique is not yet compatible with Flash Player 10 except in Internet Explorer. Hence, if you’re running Flash 10 you won’t see the replacement technique. I hope this gets fixed soon as a fix is already out for sIFR 2.

Update 2: From our comments Gyo over at (http://www.giordanopiazza.com) has released an updated and fixed up version of sIFR Lite. I plan to start using this again for our projects. Very cool!

posted in: CSS, JavaScript, development, typography

This post was published on Wednesday, January 28, 2009 at 9:00 pm

Leave a comment


Comments

1

Alex

January 29, 2009 at 9:02 am

Thank you for the post. But I’m curious of how well does that effect degrade in older browsers?

2

Bruce

January 29, 2009 at 1:00 pm

Hey Alex,

I don’t target anything older than IE6, but after testing it works great in that and IE7. I haven’t tested old versions of Firefox but it seems to do well as far as I can tell.

3

Matt Crest

January 29, 2009 at 2:32 pm

This looks pretty dang interesting Bruce. One note though – I don’t think I was the one that pointed you to sIFR Lite. My guess is these were my tweets you are referring too (#1 & #2).

And, as you tweeted just a bit ago, sIFR Lite doesn’t appear to be working if you have Flash 10 installed. I’m curious though if it will work if you use the newest version of the regular sIFR (3) to export the .swf – or is it the Javascript that’s the issue.

A follow-up would be awesome if you do get it to work!

4

pageoneresults

February 10, 2009 at 5:51 pm

Good day, just passing by while performing research on the various Image Replacement Techniques being discussed. Let me ask, why not just use the alt attribute? What are the cons of using just the alt attribute to do what it was intended to do, define alternative content? In this instance, heading text.

http://www.SEOConsultants.com/accessibility/h/

I’m currently testing the above “simple method” and I’m not sure what I’m missing but, that alt attribute performs just as it should when enclosed in elements.

“Content is “equivalent” to other content when both fulfill essentially the same function or purpose upon presentation to the user.”

5

SfR

March 12, 2009 at 1:41 pm

"that alt attribute performs just as it should when enclosed in elements."

The alt atribute displays alternative text when the element to which it is applied cannot be rendered.
It is, as you say an image replacement technique.

SiFR and Flir etc are text or font replacement techniques – the two things are completely different and unrelated. If you don't want to use browser friendly fonts or spend time making textual images in photoshop, you can use these methods instead which will render the text in required font regardless of whether or not the font installed is on the users computer.

6

gyo

April 12, 2009 at 9:17 pm

Hi Bruce, there is a fix for the compatibility with Flash Player 10+:

—————————————-
# Patrick January 29th, 2009 10:01 am :
I found and fixed a problem with sIFR Lite. The version checking is limited to single-digit versions, so it breaks after Flash Player 10. (Flash 10)

This is the culprit.
return parseInt(flashDescription.charAt(flashDescription.indexOf(”.”) – 1)) >= nRequiredVersion;

Replace with the following to fix.
var version = parseInt(flashDescription.match(/d+(?=.)/));
return version >= nRequiredVersion;
—————————————-

You might be interested in the alternative version I'm developing which already includes the bug-fix and the text-align property:
http://www.giordanopiazza.com/blog/web-design/sif...

Bye!

7

Kylie

June 15, 2010 at 7:12 pm

Is anyone having an issue when rendering text with sIFR Lite, that their links don’t work? I had a text based nav menu that worked beautifully prior to my implementing sIFR Lite. Help!